split utl::TempFile into fast and named variants
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
a08468c1a5
commit
4b95451f85
@ -116,8 +116,8 @@ class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest, pub
|
||||
public:
|
||||
ChartTest():mbSkipValidation(false) {}
|
||||
void load( std::u16string_view rDir, std::u16string_view rFileName );
|
||||
std::shared_ptr<utl::TempFile> save( const OUString& rFileName );
|
||||
std::shared_ptr<utl::TempFile> reload( const OUString& rFileName );
|
||||
std::shared_ptr<utl::TempFileNamed> save( const OUString& rFileName );
|
||||
std::shared_ptr<utl::TempFileNamed> reload( const OUString& rFileName );
|
||||
uno::Sequence < OUString > getImpressChartColumnDescriptions( std::u16string_view pDir, const char* pName );
|
||||
std::u16string_view getFileExtension( std::u16string_view rFileName );
|
||||
|
||||
@ -174,22 +174,22 @@ void ChartTest::load( std::u16string_view aDir, std::u16string_view aName )
|
||||
mxComponent = loadFromDesktop(m_directories.getURLFromSrc(aDir) + aName, maServiceName);
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile> ChartTest::save(const OUString& rFilterName)
|
||||
std::shared_ptr<utl::TempFileNamed> ChartTest::save(const OUString& rFilterName)
|
||||
{
|
||||
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
|
||||
auto aArgs(::comphelper::InitPropertySequence({
|
||||
{ "FilterName", Any(rFilterName) }
|
||||
}));
|
||||
std::shared_ptr<utl::TempFile> pTempFile = std::make_shared<utl::TempFile>();
|
||||
std::shared_ptr<utl::TempFileNamed> pTempFile = std::make_shared<utl::TempFileNamed>();
|
||||
pTempFile->EnableKillingFile();
|
||||
xStorable->storeToURL(pTempFile->GetURL(), aArgs);
|
||||
|
||||
return pTempFile;
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
|
||||
std::shared_ptr<utl::TempFileNamed> ChartTest::reload(const OUString& rFilterName)
|
||||
{
|
||||
std::shared_ptr<utl::TempFile> pTempFile = save(rFilterName);
|
||||
std::shared_ptr<utl::TempFileNamed> pTempFile = save(rFilterName);
|
||||
mxComponent->dispose();
|
||||
mxComponent = loadFromDesktop(pTempFile->GetURL(), maServiceName);
|
||||
std::cout << pTempFile->GetURL();
|
||||
@ -723,7 +723,7 @@ getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString&
|
||||
|
||||
xmlDocUniquePtr ChartTest::parseExport(const OUString& rDir, const OUString& rFilterFormat)
|
||||
{
|
||||
std::shared_ptr<utl::TempFile> pTempFile = save(rFilterFormat);
|
||||
std::shared_ptr<utl::TempFileNamed> pTempFile = save(rFilterFormat);
|
||||
|
||||
// Read the XML stream we're interested in.
|
||||
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), pTempFile->GetURL());
|
||||
|
@ -2478,13 +2478,13 @@ OUString ODbaseTable::createTempFile()
|
||||
aIdent += "/";
|
||||
|
||||
OUString sExt("." + m_pConnection->getExtension());
|
||||
TempFile aTempFile(m_Name, true, sExt, &aIdent);
|
||||
if(!aTempFile.IsValid())
|
||||
OUString aTempFileURL = utl::CreateTempURL(m_Name, true, sExt, &aIdent);
|
||||
if(aTempFileURL.isEmpty())
|
||||
getConnection()->throwGenericSQLException(STR_COULD_NOT_ALTER_TABLE, *this);
|
||||
|
||||
INetURLObject aURL;
|
||||
aURL.SetSmartProtocol(INetProtocol::File);
|
||||
aURL.SetURL(aTempFile.GetURL());
|
||||
aURL.SetURL(aTempFileURL);
|
||||
|
||||
OUString sNewName(aURL.getName().copy(0, aURL.getName().getLength() - sExt.getLength()));
|
||||
|
||||
|
@ -161,7 +161,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >&
|
||||
|
||||
bIsNewDatabase = !m_xEmbeddedStorage->hasElements();
|
||||
|
||||
m_pDatabaseFileDir.reset(new ::utl::TempFile(nullptr, true));
|
||||
m_pDatabaseFileDir.reset(new ::utl::TempFileNamed(nullptr, true));
|
||||
m_pDatabaseFileDir->EnableKillingFile();
|
||||
m_sFirebirdURL = m_pDatabaseFileDir->GetFileName() + "/firebird.fdb";
|
||||
m_sFBKPath = m_pDatabaseFileDir->GetFileName() + "/firebird.fbk";
|
||||
|
@ -104,7 +104,7 @@ namespace connectivity::firebird
|
||||
* The extracted .fbk is written in firebird.fbk, the temporary
|
||||
* .fdb is stored as firebird.fdb.
|
||||
*/
|
||||
std::unique_ptr< ::utl::TempFile > m_pDatabaseFileDir;
|
||||
std::unique_ptr< ::utl::TempFileNamed > m_pDatabaseFileDir;
|
||||
/**
|
||||
* Path for our extracted .fbk file.
|
||||
*
|
||||
|
@ -45,8 +45,8 @@ namespace connectivity::firebird
|
||||
{
|
||||
private:
|
||||
css::uno::Reference<css::uno::XComponentContext> m_aContext;
|
||||
::utl::TempFile m_firebirdTMPDirectory;
|
||||
::utl::TempFile m_firebirdLockDirectory;
|
||||
::utl::TempFileNamed m_firebirdTMPDirectory;
|
||||
::utl::TempFileNamed m_firebirdLockDirectory;
|
||||
|
||||
protected:
|
||||
::osl::Mutex m_aMutex; // mutex is need to control member access
|
||||
|
@ -30,7 +30,7 @@ class DBTestBase
|
||||
public:
|
||||
DBTestBase() : UnoApiTest("dbaccess/qa/unit/data") {};
|
||||
|
||||
utl::TempFile createTempCopy(std::u16string_view pathname);
|
||||
utl::TempFileNamed createTempCopy(std::u16string_view pathname);
|
||||
|
||||
uno::Reference< XOfficeDatabaseDocument >
|
||||
getDocumentForFileName(std::u16string_view sFileName);
|
||||
@ -42,10 +42,10 @@ public:
|
||||
uno::Reference< XOfficeDatabaseDocument > const & xDocument);
|
||||
};
|
||||
|
||||
utl::TempFile DBTestBase::createTempCopy(std::u16string_view pathname) {
|
||||
utl::TempFileNamed DBTestBase::createTempCopy(std::u16string_view pathname) {
|
||||
OUString url;
|
||||
createFileURL(pathname, url);
|
||||
utl::TempFile tmp;
|
||||
utl::TempFileNamed tmp;
|
||||
tmp.EnableKillingFile();
|
||||
auto const e = osl::File::copy(url, tmp.GetURL());
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
|
@ -195,7 +195,7 @@ void EmbeddedDBPerformanceTest::doPerformanceTestOnODB(
|
||||
std::u16string_view rDBName,
|
||||
const bool bUsePreparedStatement)
|
||||
{
|
||||
::utl::TempFile aFile;
|
||||
::utl::TempFileNamed aFile;
|
||||
aFile.EnableKillingFile();
|
||||
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ void HsqlBinaryImportTest::testBinaryImport()
|
||||
}
|
||||
|
||||
// the migration requires the file to be writable
|
||||
utl::TempFile const temp(createTempCopy(u"hsqldb_migration_test.odb"));
|
||||
utl::TempFileNamed const temp(createTempCopy(u"hsqldb_migration_test.odb"));
|
||||
uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
|
||||
|
||||
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
|
||||
|
@ -66,7 +66,7 @@ void Tdf119625Test::testTime()
|
||||
}
|
||||
|
||||
// the migration requires the file to be writable
|
||||
utl::TempFile const temp(createTempCopy(u"tdf119625.odb"));
|
||||
utl::TempFileNamed const temp(createTempCopy(u"tdf119625.odb"));
|
||||
uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
|
||||
|
||||
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
|
||||
|
@ -60,7 +60,7 @@ void Tdf126268Test::testNumbers()
|
||||
}
|
||||
|
||||
// the migration requires the file to be writable
|
||||
utl::TempFile const temp(createTempCopy(u"tdf126268.odb"));
|
||||
utl::TempFileNamed const temp(createTempCopy(u"tdf126268.odb"));
|
||||
uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
|
||||
|
||||
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
|
||||
|
@ -836,7 +836,7 @@ bool ODatabaseModelImpl::commitEmbeddedStorage( bool _bPreventRootCommits )
|
||||
bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< XStorage >& _rxStorage )
|
||||
{
|
||||
bool bTryToPreserveScriptSignature = false;
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
OUString sTmpFileUrl = aTempFile.GetURL();
|
||||
SignatureState aSignatureState = getScriptingSignatureState();
|
||||
|
@ -269,7 +269,7 @@ bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedData
|
||||
if ( bRet )
|
||||
{
|
||||
// now we need to copy the stream
|
||||
::utl::TempFile aTmp;
|
||||
::utl::TempFileNamed aTmp;
|
||||
_rAsyncDrop.aUrl = aTmp.GetURL();
|
||||
::tools::SvRef<SotTempStream> aNew = new SotTempStream( aTmp.GetFileName() );
|
||||
_rAsyncDrop.aHtmlRtfStorage->Seek(STREAM_SEEK_TO_BEGIN);
|
||||
|
@ -678,7 +678,7 @@ void DesktopLOKTest::testPaintTile()
|
||||
void DesktopLOKTest::testSaveAs()
|
||||
{
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr));
|
||||
}
|
||||
@ -689,7 +689,7 @@ void DesktopLOKTest::testSaveAsJsonOptions()
|
||||
LibLODocument_Impl* pDocument = loadDoc("3page.odg");
|
||||
|
||||
// When exporting that document to PDF, skipping the first page:
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
OString aOptions("{\"PageRange\":{\"type\":\"string\",\"value\":\"2-\"}}");
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "pdf", aOptions.getStr()));
|
||||
@ -714,7 +714,7 @@ void DesktopLOKTest::testSaveAsJsonOptions()
|
||||
void DesktopLOKTest::testSaveAsCalc()
|
||||
{
|
||||
LibLODocument_Impl* pDocument = loadDoc("search.ods");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr));
|
||||
}
|
||||
@ -2731,7 +2731,7 @@ void DesktopLOKTest::testInsertCertificate_DER_ODT()
|
||||
{
|
||||
// Load the document, save it into a temp file and load that file again
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "odt", nullptr));
|
||||
closeDoc();
|
||||
@ -2781,7 +2781,7 @@ void DesktopLOKTest::testInsertCertificate_PEM_ODT()
|
||||
{
|
||||
// Load the document, save it into a temp file and load that file again
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "odt", nullptr));
|
||||
closeDoc();
|
||||
@ -2838,7 +2838,7 @@ void DesktopLOKTest::testInsertCertificate_PEM_DOCX()
|
||||
{
|
||||
// Load the document, save it into a temp file and load that file again
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.docx");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "docx", nullptr));
|
||||
closeDoc();
|
||||
@ -2895,7 +2895,7 @@ void DesktopLOKTest::testSignDocument_PEM_PDF()
|
||||
{
|
||||
// Load the document, save it into a temp file and load that file again
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
@ -3105,7 +3105,7 @@ void DesktopLOKTest::testCalcSaveAs()
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
// Save as a new file.
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "ods", nullptr);
|
||||
closeDoc();
|
||||
|
@ -245,11 +245,11 @@ void Desktop::CreateTemporaryDirectory()
|
||||
}
|
||||
|
||||
// create new current temporary directory
|
||||
OUString aTempPath = ::utl::TempFile::SetTempNameBaseDirectory( aTempBaseURL );
|
||||
OUString aTempPath = ::utl::SetTempNameBaseDirectory( aTempBaseURL );
|
||||
if ( aTempPath.isEmpty()
|
||||
&& ::osl::File::getTempDirURL( aTempBaseURL ) == osl::FileBase::E_None )
|
||||
{
|
||||
aTempPath = ::utl::TempFile::SetTempNameBaseDirectory( aTempBaseURL );
|
||||
aTempPath = ::utl::SetTempNameBaseDirectory( aTempBaseURL );
|
||||
}
|
||||
|
||||
// set new current temporary directory
|
||||
|
@ -572,10 +572,10 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
|
||||
OUString aOutFile
|
||||
= aOutFilename.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
|
||||
std::unique_ptr<utl::TempFile> fileForCat;
|
||||
std::unique_ptr<utl::TempFileNamed> fileForCat;
|
||||
if( aDispatchRequest.aRequestType == REQUEST_CAT )
|
||||
{
|
||||
fileForCat = std::make_unique<utl::TempFile>();
|
||||
fileForCat = std::make_unique<utl::TempFileNamed>();
|
||||
if (fileForCat->IsValid())
|
||||
fileForCat->EnableKillingFile();
|
||||
else
|
||||
|
@ -285,7 +285,7 @@ bool isUserWritable(const OUString& rFileURL)
|
||||
|
||||
bool update()
|
||||
{
|
||||
utl::TempFile aTempDir(nullptr, true);
|
||||
utl::TempFileNamed aTempDir(nullptr, true);
|
||||
OUString aTempDirURL = aTempDir.GetURL();
|
||||
CopyUpdaterToTempDir(Updater::getExecutableDirURL(), aTempDirURL);
|
||||
|
||||
@ -566,7 +566,7 @@ std::string download_content(const OString& rURL, bool bFile, OUString& rHash)
|
||||
curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
|
||||
std::string response_body;
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
WriteDataFile aFile(aTempFile.GetStream(StreamMode::WRITE));
|
||||
if (!bFile)
|
||||
{
|
||||
|
@ -608,9 +608,7 @@ OUString PackageManagerImpl::insertToActivationLayer(
|
||||
Reference<XCommandEnvironment> xCmdEnv(
|
||||
sourceContent.getCommandEnvironment() );
|
||||
|
||||
OUString baseDir(m_activePackages_expanded);
|
||||
::utl::TempFile aTemp(&baseDir, false);
|
||||
OUString tempEntry = aTemp.GetURL();
|
||||
OUString tempEntry = ::utl::CreateTempURL(&m_activePackages_expanded, false);
|
||||
tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1);
|
||||
OUString destFolder = makeURL( m_activePackages, tempEntry) + "_";
|
||||
|
||||
|
@ -215,9 +215,7 @@ OUString PackageRegistryBackend::createFolder(
|
||||
ucbhelper::Content dataContent;
|
||||
::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
|
||||
|
||||
const OUString baseDir(sDataFolder);
|
||||
::utl::TempFile aTemp(&baseDir, true);
|
||||
const OUString& url = aTemp.GetURL();
|
||||
const OUString url = ::utl::CreateTempURL(&sDataFolder, true);
|
||||
return sDataFolder + url.subView(url.lastIndexOf('/'));
|
||||
}
|
||||
|
||||
|
@ -6624,7 +6624,7 @@ static void preloadData()
|
||||
// Create user profile in the temp directory for loading the dictionaries
|
||||
OUString sUserPath;
|
||||
rtl::Bootstrap::get("UserInstallation", sUserPath);
|
||||
utl::TempFile aTempDir(nullptr, true);
|
||||
utl::TempFileNamed aTempDir(nullptr, true);
|
||||
aTempDir.EnableKillingFile();
|
||||
rtl::Bootstrap::set("UserInstallation", aTempDir.GetURL());
|
||||
|
||||
|
@ -216,7 +216,7 @@ extern "C" int unopkg_main()
|
||||
Reference<XLogHandler> xFileHandler;
|
||||
Reference<XLogHandler> xConsoleHandler;
|
||||
std::unique_ptr<comphelper::EventLogger> logger;
|
||||
std::unique_ptr<utl::TempFile> pUserProfileTempDir;
|
||||
std::unique_ptr<utl::TempFileNamed> pUserProfileTempDir;
|
||||
|
||||
OptionInfo const * info_shared = getOptionInfo(
|
||||
s_option_infos, "shared" );
|
||||
@ -314,7 +314,7 @@ extern "C" int unopkg_main()
|
||||
// tdf#129917 Use temp user profile when installing shared extensions
|
||||
if (option_shared)
|
||||
{
|
||||
pUserProfileTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
pUserProfileTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
pUserProfileTempDir->EnableKillingFile();
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSaveOnThread)
|
||||
getComponent().set(loadFromDesktop(aURL, "com.sun.star.text.TextDocument", aLoadProperties));
|
||||
|
||||
// When saving that document on a thread:
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
OdtExportThread aThread(getComponent(), aTempFile.GetURL());
|
||||
aThread.create();
|
||||
|
@ -698,7 +698,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
|
||||
if( nStatus != SANE_STATUS_GOOD )
|
||||
bSynchronousRead = true;
|
||||
}
|
||||
utl::TempFile aFrame;
|
||||
utl::TempFileNamed aFrame;
|
||||
aFrame.EnableKillingFile();
|
||||
FILE* pFrame = fopen(OUStringToOString(aFrame.GetFileName(), osl_getThreadTextEncoding()).getStr(), "w+b");
|
||||
if( ! pFrame )
|
||||
|
@ -1846,9 +1846,7 @@ rtl::Reference<SdrObject> SdrPowerPointImport::ImportOLE( sal_uInt32 nOLEId,
|
||||
|
||||
rStCtrl.SeekRel( 4 );
|
||||
|
||||
::utl::TempFile aTmpFile;
|
||||
aTmpFile.EnableKillingFile();
|
||||
|
||||
::utl::TempFileFast aTmpFile;
|
||||
SvStream* pDest = aTmpFile.GetStream(StreamMode::READWRITE);
|
||||
if (pDest)
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
|
||||
if( mxSrcDoc.is() && xOStm.is() )
|
||||
{
|
||||
PDFExport aExport( mxSrcDoc, xStatusIndicator, xIH, mxContext );
|
||||
::utl::TempFile aTempFile;
|
||||
::utl::TempFileNamed aTempFile;
|
||||
|
||||
aTempFile.EnableKillingFile();
|
||||
bRet = aExport.Export( aTempFile.GetURL(), aFilterData );
|
||||
|
@ -2503,8 +2503,7 @@ void SVGFilter::implCreateObjectsFromBackground( const Reference< css::drawing::
|
||||
|
||||
GDIMetaFile aMtf;
|
||||
|
||||
utl::TempFile aFile;
|
||||
aFile.EnableKillingFile();
|
||||
utl::TempFileFast aFile;
|
||||
SvStream* pStream = aFile.GetStream(StreamMode::READWRITE);
|
||||
|
||||
Sequence< PropertyValue > aDescriptor{
|
||||
|
@ -191,8 +191,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const std::ve
|
||||
}
|
||||
|
||||
// create TypeDetection.xcu
|
||||
utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
utl::TempFileFast aTempFile;
|
||||
SvStream* pStream = aTempFile.GetStream(StreamMode::READWRITE);
|
||||
|
||||
{
|
||||
|
@ -418,7 +418,7 @@ void XMLFilterTestDialog::doExport( const Reference< XComponent >& xComp )
|
||||
Reference< XStorable > xStorable( xComp, UNO_QUERY );
|
||||
if( xStorable.is() )
|
||||
{
|
||||
utl::TempFile aTempFile(u"", true, u".xml");
|
||||
utl::TempFileNamed aTempFile(u"", true, u".xml");
|
||||
OUString aTempFileURL( aTempFile.GetURL() );
|
||||
|
||||
const application_info_impl* pAppInfo = getApplicationInfo( m_xFilterInfo->maExportService );
|
||||
@ -577,7 +577,7 @@ void XMLFilterTestDialog::import( const OUString& rURL )
|
||||
|
||||
if( m_xCBXDisplaySource->get_active() )
|
||||
{
|
||||
TempFile aTempFile(u"", true, u".xml");
|
||||
TempFileNamed aTempFile(u"", true, u".xml");
|
||||
OUString aTempFileURL( aTempFile.GetURL() );
|
||||
|
||||
Reference< XImportFilter > xImporter( mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.documentconversion.XSLTFilter", mxContext ), UNO_QUERY );
|
||||
|
@ -3485,9 +3485,7 @@ void AutoRecovery::implts_generateNewTempURL(const OUString& sBack
|
||||
|
||||
// TODO: Must we strip some illegal signs - if we use the title?
|
||||
|
||||
::utl::TempFile aTempFile(sUniqueName, true, rInfo.Extension, &sBackupPath, true);
|
||||
|
||||
rInfo.NewTempURL = aTempFile.GetURL();
|
||||
rInfo.NewTempURL = ::utl::CreateTempURL(sUniqueName, true, rInfo.Extension, &sBackupPath, true);
|
||||
}
|
||||
|
||||
void AutoRecovery::implts_informListener( Job eJob ,
|
||||
|
@ -112,7 +112,7 @@ void OlePicture::Read(HWPFile & hwpf)
|
||||
return;
|
||||
}
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE);
|
||||
|
@ -24,7 +24,7 @@ using htmlDocUniquePtr = xmlDocUniquePtr;
|
||||
class OOO_DLLPUBLIC_TEST HtmlTestTools
|
||||
{
|
||||
protected:
|
||||
static htmlDocUniquePtr parseHtml(utl::TempFile const& aTempFile);
|
||||
static htmlDocUniquePtr parseHtml(utl::TempFileNamed const& aTempFile);
|
||||
static htmlDocUniquePtr parseHtmlStream(SvStream* pStream);
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
XmlTestTools();
|
||||
virtual ~XmlTestTools();
|
||||
|
||||
static xmlDocUniquePtr parseXml(utl::TempFile const & aTempFile);
|
||||
static xmlDocUniquePtr parseXml(utl::TempFileNamed const & aTempFile);
|
||||
|
||||
virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
|
||||
|
||||
|
@ -37,7 +37,7 @@ class Directories;
|
||||
}
|
||||
namespace utl
|
||||
{
|
||||
class TempFile;
|
||||
class TempFileNamed;
|
||||
}
|
||||
|
||||
namespace com::sun::star::security
|
||||
@ -92,7 +92,7 @@ public:
|
||||
const css::uno::Sequence<css::beans::PropertyValue>& rPropertyValues);
|
||||
|
||||
/// Opens rStreamName from rTempFile, assuming it's a ZIP storage.
|
||||
static std::unique_ptr<SvStream> parseExportStream(const utl::TempFile& rTempFile,
|
||||
static std::unique_ptr<SvStream> parseExportStream(const utl::TempFileNamed& rTempFile,
|
||||
const OUString& rStreamName);
|
||||
|
||||
void setUpNssGpg(const test::Directories& rDirectories, const OUString& rTestName);
|
||||
|
@ -16,9 +16,7 @@
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_UNOTOOLS_TEMPFILE_HXX
|
||||
#define INCLUDED_UNOTOOLS_TEMPFILE_HXX
|
||||
#pragma once
|
||||
|
||||
#include <unotools/unotoolsdllapi.h>
|
||||
#include <tools/stream.hxx>
|
||||
@ -27,6 +25,74 @@
|
||||
namespace utl
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
This is the "fast" temp file. Different OSes have different ideas how this should work, so this
|
||||
class presents an interface that is fast across Windows and Unix (which differ in how they want
|
||||
temp files to work).
|
||||
The key point is that such a temporary file is only a readable/writeable stream, and does not have
|
||||
a filename, or a location in the filesystem hierarchy.
|
||||
If you need a name or a URL, you should use TempFileNamed, which is slower, but creates an actual
|
||||
file in the filesystem.
|
||||
*/
|
||||
class UNOTOOLS_DLLPUBLIC TempFileFast
|
||||
{
|
||||
std::unique_ptr<SvFileStream> mxStream;
|
||||
|
||||
public:
|
||||
TempFileFast();
|
||||
TempFileFast(TempFileFast && other) noexcept;
|
||||
~TempFileFast();
|
||||
|
||||
/**
|
||||
Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this
|
||||
alive as long as you want to use the stream.
|
||||
*/
|
||||
SvStream* GetStream( StreamMode eMode );
|
||||
|
||||
/**
|
||||
Close and destroy the owned stream object if any.
|
||||
*/
|
||||
void CloseStream();
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
Only create a "physical" file name for a temporary file that would be valid at that moment.
|
||||
Should only be used for 3rd party code with a file name interface that wants to create the file by itself.
|
||||
If you want to convert file name into a URL, always use class LocalFileHelper, but never use any
|
||||
conversion functions of osl.
|
||||
*/
|
||||
UNOTOOLS_DLLPUBLIC OUString CreateTempName();
|
||||
|
||||
UNOTOOLS_DLLPUBLIC OUString CreateTempURL( const OUString* pParent=nullptr, bool bDirectory=false );
|
||||
|
||||
/**
|
||||
Same as above; additionally the name starts with some given characters followed by a counter ( example:
|
||||
rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
|
||||
The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
|
||||
@param _bStartWithZero If set to false names will be generated like "abc","abc0","abc1"
|
||||
@param bCreateParentDirs If rLeadingChars contains a slash, this will create the required
|
||||
parent directories.
|
||||
*/
|
||||
UNOTOOLS_DLLPUBLIC OUString CreateTempURL( std::u16string_view rLeadingChars, bool _bStartWithZero=true, std::u16string_view pExtension={},
|
||||
const OUString* pParent=nullptr, bool bCreateParentDirs=false );
|
||||
|
||||
/**
|
||||
The TempNameBaseDirectory is a subfolder in the folder that is passed as a "physical" file name in the
|
||||
SetTempNameBaseDirectory method.
|
||||
This subfolder will be used if a TempFile or TempName is created without a parent name or a parent name
|
||||
that does not belong to the local file system.
|
||||
The caller of the SetTempNameBase is responsible for deleting this folder and all temporary files in it.
|
||||
The return value of both methods is the complete "physical" name of the tempname base folder.
|
||||
It is not a URL because all URLs must be "UCB compatible", so there may be no suitable URL at all.
|
||||
*/
|
||||
UNOTOOLS_DLLPUBLIC OUString SetTempNameBaseDirectory( const OUString &rBaseName );
|
||||
|
||||
// Return the URL of the temp directory (the one set with SetTempNameBaseDirectory or the
|
||||
// default tempfile folder):
|
||||
UNOTOOLS_DLLPUBLIC OUString GetTempNameBaseDirectory();
|
||||
|
||||
/**
|
||||
The class TempFile gives access to temporary files in the local file system. Sometimes they are needed because a 3rd party
|
||||
code has a file name based interface, or some file access has to be done locally without transferring tons of bytes to or
|
||||
@ -42,9 +108,9 @@ namespace utl
|
||||
So it is a potential error to convert between the filename and the URL of a TempFile object using functions or methods
|
||||
outside this class.
|
||||
*/
|
||||
|
||||
class UNOTOOLS_DLLPUBLIC TempFile
|
||||
class UNOTOOLS_DLLPUBLIC TempFileNamed
|
||||
{
|
||||
friend UNOTOOLS_DLLPUBLIC OUString SetTempNameBaseDirectory( const OUString & );
|
||||
OUString aName;
|
||||
std::unique_ptr<SvStream>
|
||||
pStream;
|
||||
@ -58,7 +124,7 @@ public:
|
||||
The temporary object is created in the local file system, even if there is no UCB that can access it.
|
||||
If the given folder is part of the local file system, the TempFile is created in this folder.
|
||||
*/
|
||||
TempFile( const OUString* pParent = nullptr, bool bDirectory=false );
|
||||
TempFileNamed( const OUString* pParent=nullptr, bool bDirectory=false );
|
||||
|
||||
/**
|
||||
Same as above; additionally the name starts with some given characters followed by a counter ( example:
|
||||
@ -68,16 +134,16 @@ public:
|
||||
@param bCreateParentDirs If rLeadingChars contains a slash, this will create the required
|
||||
parent directories.
|
||||
*/
|
||||
TempFile( std::u16string_view rLeadingChars, bool _bStartWithZero=true, std::u16string_view pExtension={},
|
||||
TempFileNamed( std::u16string_view rLeadingChars, bool _bStartWithZero=true, std::u16string_view pExtension={},
|
||||
const OUString* pParent = nullptr, bool bCreateParentDirs=false );
|
||||
|
||||
TempFile(TempFile && other) noexcept;
|
||||
TempFileNamed(TempFileNamed && other) noexcept;
|
||||
|
||||
/**
|
||||
TempFile will be removed from disk in dtor if EnableKillingFile(true) was called before.
|
||||
Temporary directories will be removed recursively in that case.
|
||||
*/
|
||||
~TempFile();
|
||||
~TempFileNamed();
|
||||
|
||||
/**
|
||||
Returns sal_True if it has a valid file name.
|
||||
@ -114,32 +180,8 @@ public:
|
||||
void EnableKillingFile( bool bEnable=true )
|
||||
{ bKillingFileEnabled = bEnable; }
|
||||
|
||||
/**
|
||||
Only create a "physical" file name for a temporary file that would be valid at that moment.
|
||||
Should only be used for 3rd party code with a file name interface that wants to create the file by itself.
|
||||
If you want to convert file name into a URL, always use class LocalFileHelper, but never use any
|
||||
conversion functions of osl.
|
||||
*/
|
||||
static OUString CreateTempName();
|
||||
|
||||
/**
|
||||
The TempNameBaseDirectory is a subfolder in the folder that is passed as a "physical" file name in the
|
||||
SetTempNameBaseDirectory method.
|
||||
This subfolder will be used if a TempFile or TempName is created without a parent name or a parent name
|
||||
that does not belong to the local file system.
|
||||
The caller of the SetTempNameBase is responsible for deleting this folder and all temporary files in it.
|
||||
The return value of both methods is the complete "physical" name of the tempname base folder.
|
||||
It is not a URL because all URLs must be "UCB compatible", so there may be no suitable URL at all.
|
||||
*/
|
||||
static OUString SetTempNameBaseDirectory( const OUString &rBaseName );
|
||||
|
||||
// Return the URL of the temp directory (the one set with SetTempNameBaseDirectory or the
|
||||
// default tempfile folder):
|
||||
static OUString GetTempNameBaseDirectory();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -92,7 +92,7 @@ void OoxDrawingmlTest::loadAndReload(const OUString& rURL, const OUString& rFilt
|
||||
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= rFilterName;
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
mxComponent->dispose();
|
||||
@ -346,7 +346,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow)
|
||||
uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OUString("Impress Office Open XML");
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
getComponent()->dispose();
|
||||
|
@ -26,13 +26,13 @@ class Test : public test::BootstrapFixture, public unotest::MacrosTest, public X
|
||||
{
|
||||
private:
|
||||
uno::Reference<lang::XComponent> mxComponent;
|
||||
utl::TempFile maTempFile;
|
||||
utl::TempFileNamed maTempFile;
|
||||
|
||||
public:
|
||||
void setUp() override;
|
||||
void tearDown() override;
|
||||
void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) override;
|
||||
utl::TempFile& getTempFile() { return maTempFile; }
|
||||
utl::TempFileNamed& getTempFile() { return maTempFile; }
|
||||
void loadAndSave(const OUString& rURL, const OUString& rFilterName);
|
||||
};
|
||||
|
||||
|
@ -484,7 +484,6 @@ void OWriteStream_Impl::GetFilledTempFileIfNo( const uno::Reference< io::XInputS
|
||||
if ( !m_oTempFile.has_value() )
|
||||
{
|
||||
m_oTempFile.emplace();
|
||||
m_oTempFile->EnableKillingFile();
|
||||
|
||||
try {
|
||||
if ( xStream.is() )
|
||||
@ -550,7 +549,6 @@ void OWriteStream_Impl::FillTempGetFileName()
|
||||
else if ( !m_oTempFile.has_value() )
|
||||
{
|
||||
m_oTempFile.emplace();
|
||||
m_oTempFile->EnableKillingFile();
|
||||
|
||||
try {
|
||||
// copy stream contents to the file
|
||||
|
@ -74,7 +74,7 @@ struct OWriteStream_Impl
|
||||
friend class OInputCompStream;
|
||||
|
||||
OWriteStream* m_pAntiImpl;
|
||||
std::optional<utl::TempFile> m_oTempFile;
|
||||
std::optional<utl::TempFileFast> m_oTempFile;
|
||||
|
||||
css::uno::Reference< css::io::XStream > m_xCacheStream;
|
||||
css::uno::Reference< css::io::XSeekable > m_xCacheSeek;
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
|
||||
OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< uno::XComponentContext >& xContext, utl::TempFile aTempFile )
|
||||
OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< uno::XComponentContext >& xContext, utl::TempFileFast aTempFile )
|
||||
: m_oTempFile( std::move(aTempFile) )
|
||||
{
|
||||
uno::Reference< uno::XComponentContext > xOwnContext = xContext;
|
||||
|
@ -35,11 +35,11 @@ struct OWriteStream_Impl;
|
||||
class OSelfTerminateFileStream final : public cppu::WeakImplHelper< css::io::XInputStream,
|
||||
css::io::XSeekable >
|
||||
{
|
||||
std::optional<utl::TempFile> m_oTempFile;
|
||||
std::optional<utl::TempFileFast> m_oTempFile;
|
||||
rtl::Reference< utl::OSeekableInputStreamWrapper > m_xStreamWrapper;
|
||||
|
||||
public:
|
||||
OSelfTerminateFileStream( const css::uno::Reference< css::uno::XComponentContext >& xContext, utl::TempFile aTempFile );
|
||||
OSelfTerminateFileStream( const css::uno::Reference< css::uno::XComponentContext >& xContext, utl::TempFileFast aTempFile );
|
||||
|
||||
virtual ~OSelfTerminateFileStream() override;
|
||||
|
||||
|
@ -171,12 +171,14 @@ OUString OReportEngineJFree::getNewOutputName()
|
||||
OUString sName = m_xReport->getCaption();
|
||||
if ( sName.isEmpty() )
|
||||
sName = m_xReport->getName();
|
||||
sFileURL = ::utl::CreateTempURL(sName, false, sExt);
|
||||
if ( sFileURL.isEmpty() )
|
||||
{
|
||||
::utl::TempFile aTestFile(sName, false, sExt);
|
||||
::utl::TempFileNamed aTestFile(sName, false, sExt);
|
||||
if ( !aTestFile.IsValid() )
|
||||
{
|
||||
sName = RptResId(RID_STR_REPORT);
|
||||
::utl::TempFile aFile(sName, false, sExt);
|
||||
::utl::TempFileNamed aFile(sName, false, sExt);
|
||||
sFileURL = aFile.GetURL();
|
||||
}
|
||||
else
|
||||
|
@ -39,7 +39,7 @@ class ScHTMLExportTest : public test::BootstrapFixture, public unotest::MacrosTe
|
||||
mxComponent = loadFromDesktop(m_directories.getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.comp.Calc.SpreadsheetDocument");
|
||||
}
|
||||
|
||||
void save(const OUString& aFilterName, TempFile const & rTempFile)
|
||||
void save(const OUString& aFilterName, TempFileNamed const & rTempFile)
|
||||
{
|
||||
Reference<XStorable> xStorable(mxComponent, UNO_QUERY);
|
||||
MediaDescriptor aMediaDescriptor;
|
||||
@ -70,10 +70,10 @@ public:
|
||||
void testHtmlSkipImage()
|
||||
{
|
||||
// need a temp dir, because there's an image exported too
|
||||
TempFile aTempDir(nullptr, true);
|
||||
TempFileNamed aTempDir(nullptr, true);
|
||||
aTempDir.EnableKillingFile();
|
||||
OUString const url(aTempDir.GetURL());
|
||||
TempFile aTempFile(&url, false);
|
||||
TempFileNamed aTempFile(&url, false);
|
||||
|
||||
htmlDocUniquePtr pDoc;
|
||||
|
||||
|
@ -122,7 +122,7 @@ void ScMacrosTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
|
||||
void ScMacrosTest::saveAndReload(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter)
|
||||
{
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
css::uno::Sequence aArgs{ comphelper::makePropertyValue("FilterName", rFilter) };
|
||||
css::uno::Reference<css::frame::XStorable> xStorable(xComponent, css::uno::UNO_QUERY_THROW);
|
||||
@ -314,7 +314,7 @@ void ScMacrosTest::testMacroButtonFormControlXlsxExport()
|
||||
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OUString("Calc MS Excel 2007 VBA XML");
|
||||
auto pTempFile = std::make_shared<utl::TempFile>();
|
||||
auto pTempFile = std::make_shared<utl::TempFileNamed>();
|
||||
pTempFile->EnableKillingFile();
|
||||
xStorable->storeToURL(pTempFile->GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent->dispose();
|
||||
|
@ -33,9 +33,9 @@ using namespace com::sun::star;
|
||||
|
||||
namespace sc_apitest
|
||||
{
|
||||
static utl::TempFile createTempCopy(OUString const& url)
|
||||
static utl::TempFileNamed createTempCopy(OUString const& url)
|
||||
{
|
||||
utl::TempFile tmp;
|
||||
utl::TempFileNamed tmp;
|
||||
tmp.EnableKillingFile();
|
||||
auto const e = osl::File::copy(url, tmp.GetURL());
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
@ -50,7 +50,7 @@ namespace
|
||||
{
|
||||
struct TempFileBase
|
||||
{
|
||||
utl::TempFile m_TempFile;
|
||||
utl::TempFileNamed m_TempFile;
|
||||
explicit TempFileBase(OUString const& url)
|
||||
: m_TempFile(createTempCopy(url))
|
||||
{
|
||||
|
@ -51,12 +51,12 @@ public:
|
||||
|
||||
// helpers
|
||||
private:
|
||||
std::shared_ptr<utl::TempFile> exportToPDF(const uno::Reference<frame::XModel>& xModel,
|
||||
const ScRange& range);
|
||||
std::shared_ptr<utl::TempFileNamed> exportToPDF(const uno::Reference<frame::XModel>& xModel,
|
||||
const ScRange& range);
|
||||
|
||||
std::shared_ptr<utl::TempFile> exportToPDFWithUnoCommands(const OUString& rRange);
|
||||
std::shared_ptr<utl::TempFileNamed> exportToPDFWithUnoCommands(const OUString& rRange);
|
||||
|
||||
static bool hasTextInPdf(const std::shared_ptr<utl::TempFile>& pPDFFile, const char* sText,
|
||||
static bool hasTextInPdf(const std::shared_ptr<utl::TempFileNamed>& pPDFFile, const char* sText,
|
||||
bool& bFound);
|
||||
|
||||
void setFont(ScFieldEditEngine& rEE, sal_Int32 nStart, sal_Int32 nEnd,
|
||||
@ -110,7 +110,7 @@ void ScPDFExportTest::tearDown()
|
||||
test::BootstrapFixture::tearDown();
|
||||
}
|
||||
|
||||
bool ScPDFExportTest::hasTextInPdf(const std::shared_ptr<utl::TempFile>& pPDFFile,
|
||||
bool ScPDFExportTest::hasTextInPdf(const std::shared_ptr<utl::TempFileNamed>& pPDFFile,
|
||||
const char* sText, bool& bFound)
|
||||
{
|
||||
SvStream* pStream = pPDFFile->GetStream(StreamMode::STD_READ);
|
||||
@ -140,11 +140,11 @@ bool ScPDFExportTest::hasTextInPdf(const std::shared_ptr<utl::TempFile>& pPDFFil
|
||||
return (nRead == nFileSize);
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile>
|
||||
std::shared_ptr<utl::TempFileNamed>
|
||||
ScPDFExportTest::exportToPDF(const uno::Reference<frame::XModel>& xModel, const ScRange& range)
|
||||
{
|
||||
// create temp file name
|
||||
auto pTempFile = std::make_shared<utl::TempFile>();
|
||||
auto pTempFile = std::make_shared<utl::TempFileNamed>();
|
||||
pTempFile->EnableKillingFile();
|
||||
OUString sFileURL = pTempFile->GetURL();
|
||||
// Note: under Windows path path should be with "/" delimiters instead of "\\"
|
||||
@ -195,10 +195,11 @@ ScPDFExportTest::exportToPDF(const uno::Reference<frame::XModel>& xModel, const
|
||||
return pTempFile;
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile> ScPDFExportTest::exportToPDFWithUnoCommands(const OUString& rRange)
|
||||
std::shared_ptr<utl::TempFileNamed>
|
||||
ScPDFExportTest::exportToPDFWithUnoCommands(const OUString& rRange)
|
||||
{
|
||||
// create temp file name
|
||||
auto pTempFile = std::make_shared<utl::TempFile>();
|
||||
auto pTempFile = std::make_shared<utl::TempFileNamed>();
|
||||
pTempFile->EnableKillingFile();
|
||||
OUString sFileURL = pTempFile->GetURL();
|
||||
// Note: under Windows path path should be with "/" delimiters instead of "\\"
|
||||
@ -276,7 +277,7 @@ void ScPDFExportTest::testExportRange_Tdf120161()
|
||||
// A1:G1
|
||||
{
|
||||
ScRange range1(0, 0, 0, 6, 0, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "DejaVuSans", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(false, bFound);
|
||||
@ -285,7 +286,7 @@ void ScPDFExportTest::testExportRange_Tdf120161()
|
||||
// G1:H1
|
||||
{
|
||||
ScRange range1(6, 0, 0, 7, 0, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "DejaVuSans", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -294,7 +295,7 @@ void ScPDFExportTest::testExportRange_Tdf120161()
|
||||
// H1:I1
|
||||
{
|
||||
ScRange range1(7, 0, 0, 8, 0, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "DejaVuSans", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -329,7 +330,7 @@ void ScPDFExportTest::testExportFitToPage_Tdf103516()
|
||||
// A1:G50: 2-page export
|
||||
{
|
||||
ScRange range1(0, 0, 0, 6, 49, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 2>>", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -338,7 +339,7 @@ void ScPDFExportTest::testExportFitToPage_Tdf103516()
|
||||
// A1:L80: 4-page export
|
||||
{
|
||||
ScRange range1(0, 0, 0, 11, 79, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 4>>", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -368,7 +369,7 @@ void ScPDFExportTest::testExportFitToPage_Tdf103516()
|
||||
// A1:G50 with fit to page width=1: slightly smaller zoom results only 1-page export
|
||||
{
|
||||
ScRange range1(0, 0, 0, 6, 49, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 1>>", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -377,7 +378,7 @@ void ScPDFExportTest::testExportFitToPage_Tdf103516()
|
||||
// A1:L80 with fit to page width=1: slightly smaller zoom results only 1-page export
|
||||
{
|
||||
ScRange range1(0, 0, 0, 11, 79, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 1>>", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -391,7 +392,7 @@ void ScPDFExportTest::testUnoCommands_Tdf120161()
|
||||
|
||||
// A1:G1
|
||||
{
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDFWithUnoCommands("A1:G1");
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDFWithUnoCommands("A1:G1");
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "DejaVuSans", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(false, bFound);
|
||||
@ -399,7 +400,7 @@ void ScPDFExportTest::testUnoCommands_Tdf120161()
|
||||
|
||||
// G1:H1
|
||||
{
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDFWithUnoCommands("G1:H1");
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDFWithUnoCommands("G1:H1");
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "DejaVuSans", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -407,7 +408,7 @@ void ScPDFExportTest::testUnoCommands_Tdf120161()
|
||||
|
||||
// H1:I1
|
||||
{
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDFWithUnoCommands("H1:I1");
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDFWithUnoCommands("H1:I1");
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "DejaVuSans", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -424,7 +425,7 @@ void ScPDFExportTest::testTdf64703_hiddenPageBreak()
|
||||
// A1:A11: 4-page export
|
||||
{
|
||||
ScRange range1(0, 0, 0, 0, 10, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
bool bFound = false;
|
||||
CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 4>>", bFound));
|
||||
CPPUNIT_ASSERT_EQUAL(true, bFound);
|
||||
@ -445,7 +446,7 @@ void ScPDFExportTest::testTdf143978()
|
||||
|
||||
// A1:A2
|
||||
ScRange range1(0, 0, 0, 0, 1, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
// Parse the export result with pdfium.
|
||||
SvFileStream aFile(pPDFFile->GetURL(), StreamMode::READ);
|
||||
SvMemoryStream aMemory;
|
||||
@ -492,7 +493,7 @@ void ScPDFExportTest::testTdf84012()
|
||||
|
||||
// A1
|
||||
ScRange range1(0, 0, 0, 0, 0, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
// Parse the export result with pdfium.
|
||||
SvFileStream aFile(pPDFFile->GetURL(), StreamMode::READ);
|
||||
SvMemoryStream aMemory;
|
||||
@ -533,7 +534,7 @@ void ScPDFExportTest::testTdf78897()
|
||||
|
||||
// C3:D3
|
||||
ScRange range1(2, 2, 0, 3, 2, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
// Parse the export result with pdfium.
|
||||
SvFileStream aFile(pPDFFile->GetURL(), StreamMode::READ);
|
||||
SvMemoryStream aMemory;
|
||||
@ -569,7 +570,7 @@ void ScPDFExportTest::testForcepoint97()
|
||||
|
||||
// A1:H81
|
||||
ScRange range1(0, 0, 0, 7, 81, 0);
|
||||
std::shared_ptr<utl::TempFile> pPDFFile = exportToPDF(xModel, range1);
|
||||
std::shared_ptr<utl::TempFileNamed> pPDFFile = exportToPDF(xModel, range1);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(ScPDFExportTest);
|
||||
|
@ -186,7 +186,8 @@ void SparklineImportExportTest::testSparklinesExportODS()
|
||||
ScDocShellRef xDocSh = loadDoc(u"Sparklines.", FORMAT_XLSX);
|
||||
|
||||
// Save as ODS and check content.xml with XPath
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
|
||||
// We have 3 sparkline groups = 3 tables that contain sparklines
|
||||
@ -250,7 +251,8 @@ void SparklineImportExportTest::testNoSparklinesInDocumentXLSX()
|
||||
// Load the document containing NO sparklines
|
||||
ScDocShellRef xDocSh = loadDoc(u"empty.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pXmlDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
|
@ -760,9 +760,9 @@ void ScBootstrapFixture::createCSVPath(std::u16string_view aFileBase, OUString&
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReload(
|
||||
ScDocShell& rShell, const OUString &rFilter,
|
||||
const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType,
|
||||
std::shared_ptr<utl::TempFile>* pTempFileOut, const OUString* pPassword, bool bClose)
|
||||
std::shared_ptr<utl::TempFileNamed>* pTempFileOut, const OUString* pPassword, bool bClose)
|
||||
{
|
||||
auto pTempFile = std::make_shared<utl::TempFile>();
|
||||
auto pTempFile = std::make_shared<utl::TempFileNamed>();
|
||||
SfxMedium aStoreMedium( pTempFile->GetURL(), StreamMode::STD_WRITE );
|
||||
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
|
||||
if (nFormatType == ODS_FORMAT_TYPE)
|
||||
@ -804,7 +804,7 @@ ScDocShellRef ScBootstrapFixture::saveAndReload(
|
||||
return xDocSh;
|
||||
}
|
||||
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReload( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFile>* pTempFile )
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReload( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFileNamed>* pTempFile )
|
||||
{
|
||||
OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
|
||||
OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
|
||||
@ -814,7 +814,7 @@ ScDocShellRef ScBootstrapFixture::saveAndReload( ScDocShell& rShell, sal_Int32 n
|
||||
return xDocSh;
|
||||
}
|
||||
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReloadPassword( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFile>* pTempFile )
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReloadPassword( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFileNamed>* pTempFile )
|
||||
{
|
||||
OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
|
||||
OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
|
||||
@ -826,7 +826,7 @@ ScDocShellRef ScBootstrapFixture::saveAndReloadPassword( ScDocShell& rShell, sal
|
||||
return xDocSh;
|
||||
}
|
||||
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReloadNoClose( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFile>* pTempFile )
|
||||
ScDocShellRef ScBootstrapFixture::saveAndReloadNoClose( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFileNamed>* pTempFile )
|
||||
{
|
||||
OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
|
||||
OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
|
||||
@ -837,12 +837,12 @@ ScDocShellRef ScBootstrapFixture::saveAndReloadNoClose( ScDocShell& rShell, sal_
|
||||
return xDocSh;
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile> ScBootstrapFixture::exportTo( ScDocShell& rShell, sal_Int32 nFormat, bool bValidate )
|
||||
std::shared_ptr<utl::TempFileNamed> ScBootstrapFixture::exportTo( ScDocShell& rShell, sal_Int32 nFormat, bool bValidate )
|
||||
{
|
||||
OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
|
||||
OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
auto pTempFile = std::make_shared<utl::TempFile>();
|
||||
auto pTempFile = std::make_shared<utl::TempFileNamed>();
|
||||
pTempFile->EnableKillingFile();
|
||||
SfxMedium aStoreMedium( pTempFile->GetURL(), StreamMode::STD_WRITE );
|
||||
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
|
||||
namespace utl { class TempFile; }
|
||||
namespace utl { class TempFileNamed; }
|
||||
|
||||
#define ODS_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::TEMPLATE | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT | SfxFilterFlags::ENCRYPTION | SfxFilterFlags::PASSWORDTOMODIFY)
|
||||
#define XLS_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::ENCRYPTION | SfxFilterFlags::PASSWORDTOMODIFY | SfxFilterFlags::PREFERED)
|
||||
@ -219,13 +219,13 @@ public:
|
||||
|
||||
ScDocShellRef saveAndReload(ScDocShell& rShell, const OUString &rFilter,
|
||||
const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType,
|
||||
std::shared_ptr<utl::TempFile>* pTempFile = nullptr, const OUString* pPassword = nullptr, bool bClose = true );
|
||||
std::shared_ptr<utl::TempFileNamed>* pTempFile = nullptr, const OUString* pPassword = nullptr, bool bClose = true );
|
||||
|
||||
ScDocShellRef saveAndReload( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFile>* pTempFile = nullptr );
|
||||
ScDocShellRef saveAndReloadPassword( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFile>* pTempFile = nullptr );
|
||||
ScDocShellRef saveAndReloadNoClose( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFile>* pTempFile = nullptr );
|
||||
ScDocShellRef saveAndReload( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFileNamed>* pTempFile = nullptr );
|
||||
ScDocShellRef saveAndReloadPassword( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFileNamed>* pTempFile = nullptr );
|
||||
ScDocShellRef saveAndReloadNoClose( ScDocShell& rShell, sal_Int32 nFormat, std::shared_ptr<utl::TempFileNamed>* pTempFile = nullptr );
|
||||
|
||||
std::shared_ptr<utl::TempFile> exportTo(ScDocShell& rShell, sal_Int32 nFormat, bool bValidate = true);
|
||||
std::shared_ptr<utl::TempFileNamed> exportTo(ScDocShell& rShell, sal_Int32 nFormat, bool bValidate = true);
|
||||
|
||||
void miscRowHeightsTest( TestParam const * aTestValues, unsigned int numElems );
|
||||
};
|
||||
|
@ -21,12 +21,12 @@
|
||||
|
||||
xmlDocUniquePtr XPathHelper::parseExport2(ScBootstrapFixture & rFixture, ScDocShell& rShell, uno::Reference<lang::XMultiServiceFactory> const & xSFactory, const OUString& rFile, sal_Int32 nFormat)
|
||||
{
|
||||
std::shared_ptr<utl::TempFile> pTempFile = rFixture.exportTo(rShell, nFormat);
|
||||
std::shared_ptr<utl::TempFileNamed> pTempFile = rFixture.exportTo(rShell, nFormat);
|
||||
|
||||
return parseExport(pTempFile, xSFactory, rFile);
|
||||
}
|
||||
|
||||
std::unique_ptr<SvStream> XPathHelper::parseExportStream(std::shared_ptr<utl::TempFile> const & pTempFile, uno::Reference<lang::XMultiServiceFactory> const & xSFactory, const OUString& rFile)
|
||||
std::unique_ptr<SvStream> XPathHelper::parseExportStream(std::shared_ptr<utl::TempFileNamed> const & pTempFile, uno::Reference<lang::XMultiServiceFactory> const & xSFactory, const OUString& rFile)
|
||||
{
|
||||
// Read the XML stream we're interested in.
|
||||
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(xSFactory), pTempFile->GetURL());
|
||||
@ -36,7 +36,7 @@ std::unique_ptr<SvStream> XPathHelper::parseExportStream(std::shared_ptr<utl::Te
|
||||
return pStream;
|
||||
}
|
||||
|
||||
xmlDocUniquePtr XPathHelper::parseExport(std::shared_ptr<utl::TempFile> const & pTempFile, uno::Reference<lang::XMultiServiceFactory> const & xSFactory, const OUString& rFile)
|
||||
xmlDocUniquePtr XPathHelper::parseExport(std::shared_ptr<utl::TempFileNamed> const & pTempFile, uno::Reference<lang::XMultiServiceFactory> const & xSFactory, const OUString& rFile)
|
||||
{
|
||||
std::unique_ptr<SvStream> pStream = parseExportStream(pTempFile, xSFactory, rFile);
|
||||
return XmlTestTools::parseXmlStream(pStream.get());
|
||||
|
@ -46,7 +46,7 @@ namespace XPathHelper
|
||||
/**
|
||||
* Tries to parse the specified file in the temp file zip container as a binary file.
|
||||
*/
|
||||
SCQAHELPER_DLLPUBLIC std::unique_ptr<SvStream> parseExportStream(std::shared_ptr<utl::TempFile> const & pTempFile,
|
||||
SCQAHELPER_DLLPUBLIC std::unique_ptr<SvStream> parseExportStream(std::shared_ptr<utl::TempFileNamed> const & pTempFile,
|
||||
uno::Reference<lang::XMultiServiceFactory> const & xSFactory, const OUString& rFile);
|
||||
|
||||
/**
|
||||
@ -55,7 +55,7 @@ namespace XPathHelper
|
||||
* Should be used when the same exported file is used for testing different files in
|
||||
* the same zip file.
|
||||
*/
|
||||
SCQAHELPER_DLLPUBLIC xmlDocUniquePtr parseExport(std::shared_ptr<utl::TempFile> const & pTempFile, uno::Reference< lang::XMultiServiceFactory> const & xSFactory,
|
||||
SCQAHELPER_DLLPUBLIC xmlDocUniquePtr parseExport(std::shared_ptr<utl::TempFileNamed> const & pTempFile, uno::Reference< lang::XMultiServiceFactory> const & xSFactory,
|
||||
const OUString& rFile);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ void ScJumboSheetsTest::testRoundtripColumnRange()
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), rDoc.GetFormula(1, 0, 0));
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile> exportedFile;
|
||||
std::shared_ptr<utl::TempFileNamed> exportedFile;
|
||||
ScDocShellRef xDocSh2 = saveAndReloadNoClose(*xDocSh1, FORMAT_ODS, &exportedFile);
|
||||
CPPUNIT_ASSERT(xDocSh2.is());
|
||||
|
||||
@ -189,7 +189,7 @@ void ScJumboSheetsTest::testRoundtripNamedRanges()
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<utl::TempFile> exportedFile;
|
||||
std::shared_ptr<utl::TempFileNamed> exportedFile;
|
||||
ScDocShellRef xDocSh2 = saveAndReloadNoClose(*xDocSh1, FORMAT_ODS, &exportedFile);
|
||||
CPPUNIT_ASSERT(xDocSh2.is());
|
||||
|
||||
|
@ -744,7 +744,8 @@ void ScPivotTableFiltersTest::testPivotTableExportXLSX()
|
||||
|
||||
ScDocShellRef xShell = loadDoc(u"tdf89139_pivot_table.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -762,7 +763,8 @@ void ScPivotTableFiltersTest::testPivotTableExportXLSXSingleDataField()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"tdf123421_1datafield.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -784,7 +786,8 @@ void ScPivotTableFiltersTest::testPivotTableExportXLSXMultipleDataFields()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"tdf123421_2datafields.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -817,7 +820,8 @@ void ScPivotTableFiltersTest::testPivotCacheExportXLSX()
|
||||
|
||||
ScDocShellRef xShell = loadDoc(u"pivot-table/with-strings-integers-and-dates.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pCacheDef = XPathHelper::parseExport(pXPathFile, m_xSFactory,
|
||||
"xl/pivotCache/pivotCacheDefinition1.xml");
|
||||
CPPUNIT_ASSERT(pCacheDef);
|
||||
@ -1943,7 +1947,8 @@ void ScPivotTableFiltersTest::testPivotTableFirstHeaderRowXLSX()
|
||||
// The documentation is not clear about what firstHeaderRow actually means, but MS Excel works on this way
|
||||
ScDocShellRef xShell = loadDoc(u"pivot_table_first_header_row.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -2398,7 +2403,8 @@ void ScPivotTableFiltersTest::testPivotTableOutlineModeXLSX()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"pivottable_outline_mode.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -2417,7 +2423,8 @@ void ScPivotTableFiltersTest::testPivotTableDuplicatedMemberFilterXLSX()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"pivottable_duplicated_member_filter.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -2435,7 +2442,8 @@ void ScPivotTableFiltersTest::testPivotTableTabularModeXLSX()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"pivottable_tabular_mode.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -2455,7 +2463,8 @@ void ScPivotTableFiltersTest::testPivotTableDuplicateFields()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"caseinsensitive-duplicate-fields.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pCacheDef = XPathHelper::parseExport(pXPathFile, m_xSFactory,
|
||||
"xl/pivotCache/pivotCacheDefinition1.xml");
|
||||
CPPUNIT_ASSERT(pCacheDef);
|
||||
@ -2509,7 +2518,8 @@ void ScPivotTableFiltersTest::testTdf123923()
|
||||
|
||||
ScDocShellRef xShell = loadDoc(u"pivot-table-err-in-cache.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
|
||||
"xl/pivotCache/pivotCacheDefinition1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -2524,7 +2534,8 @@ void ScPivotTableFiltersTest::testTdf123939()
|
||||
|
||||
ScDocShellRef xShell = loadDoc(u"pivot-table-str-and-err-in-data.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
|
||||
"xl/pivotCache/pivotCacheDefinition1.xml");
|
||||
CPPUNIT_ASSERT(pTable);
|
||||
@ -2560,7 +2571,8 @@ void ScPivotTableFiltersTest::testTdf124736()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"pivot-table/shared-dategroup.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xDocSh->DoClose();
|
||||
|
||||
xmlDocUniquePtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
|
||||
@ -2612,7 +2624,8 @@ void ScPivotTableFiltersTest::tesTtdf124772NumFmt()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"pivot-table-num-fmt.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xDocSh->DoClose();
|
||||
|
||||
xmlDocUniquePtr pTable
|
||||
|
@ -107,7 +107,7 @@ ScShapeTest::ScShapeTest()
|
||||
void ScShapeTest::saveAndReload(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter)
|
||||
{
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
css::uno::Sequence aArgs{ comphelper::makePropertyValue("FilterName",
|
||||
rFilter) }; // e.g. "calc8"
|
||||
|
@ -357,7 +357,8 @@ void ScExportTest::testTdf139167()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/styles.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
|
||||
@ -375,7 +376,8 @@ void ScExportTest::testTdf113271()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/styles.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
|
||||
@ -397,7 +399,8 @@ void ScExportTest::testTdf139394()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -428,7 +431,8 @@ void ScExportTest::testExtCondFormatXLSX()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -474,7 +478,8 @@ void ScExportTest::testTdf90104()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -657,7 +662,8 @@ void ScExportTest::testProtectionKeyODS_UTF16LErtlSHA1()
|
||||
|
||||
// we can't assume that the user entered the password; check that we
|
||||
// round-trip the password as-is
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
assertXPath(pXmlDoc,
|
||||
"//office:spreadsheet[@table:structure-protected='true' and "
|
||||
@ -685,7 +691,8 @@ void ScExportTest::testProtectionKeyODS_UTF8SHA1()
|
||||
|
||||
// we can't assume that the user entered the password; check that we
|
||||
// round-trip the password as-is
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
assertXPath(pXmlDoc,
|
||||
"//office:spreadsheet[@table:structure-protected='true' and "
|
||||
@ -713,7 +720,8 @@ void ScExportTest::testProtectionKeyODS_UTF8SHA256ODF12()
|
||||
|
||||
// we can't assume that the user entered the password; check that we
|
||||
// round-trip the password as-is
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
assertXPath(
|
||||
pXmlDoc,
|
||||
@ -743,7 +751,8 @@ void ScExportTest::testProtectionKeyODS_UTF8SHA256W3C()
|
||||
|
||||
// we can't assume that the user entered the password; check that we
|
||||
// round-trip the password as-is
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
assertXPath(
|
||||
pXmlDoc,
|
||||
@ -773,7 +782,8 @@ void ScExportTest::testProtectionKeyODS_XL_SHA1()
|
||||
|
||||
// we can't assume that the user entered the password; check that we
|
||||
// round-trip the password as-is
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
assertXPath(
|
||||
pXmlDoc,
|
||||
@ -856,7 +866,8 @@ void ScExportTest::testCommentExportXLSX()
|
||||
//tdf#104729 FILESAVE OpenOffice do not save author of the comment during export to .xlsx
|
||||
ScDocShellRef xShell = loadDoc(u"comment.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pComments
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml");
|
||||
CPPUNIT_ASSERT(pComments);
|
||||
@ -901,7 +912,8 @@ void ScExportTest::testCommentExportXLSX_2_XLSX()
|
||||
|
||||
pNote->ShowCaption(aPosC9, true);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pComments
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml");
|
||||
CPPUNIT_ASSERT(pComments);
|
||||
@ -924,7 +936,8 @@ void ScExportTest::testCustomColumnWidthExportXLSX()
|
||||
//tdf#100946 FILESAVE Excel on macOS ignored column widths in XLSX last saved by LO
|
||||
ScDocShellRef xShell = loadDoc(u"custom_column_width.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -999,7 +1012,8 @@ void ScExportTest::testXfDefaultValuesXLSX()
|
||||
//tdf#70565 FORMATTING: User Defined Custom Formatting is not applied during importing XLSX documents
|
||||
ScDocShellRef xShell = loadDoc(u"xf_default_values.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/styles.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
|
||||
@ -1087,7 +1101,7 @@ void ScExportTest::testODF13()
|
||||
officecfg::Office::Common::Save::ODF::DefaultVersion::set(10, pBatch);
|
||||
pBatch->commit();
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*pShell, FORMAT_ODS);
|
||||
|
||||
// check XML
|
||||
@ -1116,7 +1130,7 @@ void ScExportTest::testODF13()
|
||||
officecfg::Office::Common::Save::ODF::DefaultVersion::set(9, pBatch);
|
||||
pBatch->commit();
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= exportTo(*pShell, FORMAT_ODS, /*bValidate*/ false);
|
||||
pShell->DoClose();
|
||||
|
||||
@ -1146,7 +1160,7 @@ void ScExportTest::testODF13()
|
||||
officecfg::Office::Common::Save::ODF::DefaultVersion::set(4, pBatch);
|
||||
pBatch->commit();
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = exportTo(*pShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile = exportTo(*pShell, FORMAT_ODS);
|
||||
pShell->DoClose();
|
||||
|
||||
// check XML
|
||||
@ -1177,7 +1191,8 @@ void ScExportTest::testColumnWidthResaveXLSX()
|
||||
// Test if after resave .xlsx file, columns width is identical with previous one
|
||||
ScDocShellRef xShell = loadDoc(u"different-column-width-excel2010.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1282,7 +1297,8 @@ void ScExportTest::testOutlineExportXLSX()
|
||||
//tdf#51524 FILESAVE .xlsx and.xls looses width information for hidden/collapsed grouped columns
|
||||
ScDocShellRef xShell = loadDoc(u"outline.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1429,7 +1445,7 @@ void ScExportTest::testAllRowsHiddenXLSX()
|
||||
{
|
||||
ScDocShellRef xOrigDocSh = loadDoc(u"tdf105840_allRowsHidden.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xOrigDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -1445,7 +1461,8 @@ void ScExportTest::testHiddenEmptyRowsXLSX()
|
||||
//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX
|
||||
ScDocShellRef xShell = loadDoc(u"hidden-empty-rows.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1464,7 +1481,8 @@ void ScExportTest::testHiddenEmptyColsODS()
|
||||
//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX
|
||||
ScDocShellRef xShell = loadDoc(u"tdf128895_emptyHiddenCols.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
assertXPath(pSheet, "//table:table/table:table-column[2]");
|
||||
@ -1478,7 +1496,8 @@ void ScExportTest::testLandscapeOrientationXLSX()
|
||||
//tdf#48767 - Landscape page orientation is not loaded from .xlsx format with MS Excel, after export with Libre Office
|
||||
ScDocShellRef xShell = loadDoc(u"hidden-empty-rows.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -2194,7 +2213,8 @@ void ScExportTest::testRichTextCellFormatXLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"cellformat.", FORMAT_XLS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -2448,7 +2468,8 @@ void ScExportTest::testEmbeddedChartODS()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"embedded-chart.", FORMAT_XLS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pTempFile(ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS));
|
||||
std::shared_ptr<utl::TempFileNamed> pTempFile(
|
||||
ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS));
|
||||
|
||||
xmlDocUniquePtr pDoc = XPathHelper::parseExport(pTempFile, m_xSFactory, "content.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -3194,7 +3215,8 @@ void ScExportTest::testTdf133487()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"shapes_foreground_background.", FORMAT_FODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_ODS);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "content.xml");
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
|
||||
@ -3562,7 +3584,8 @@ void ScExportTest::testCeilingFloorODSToXLSX()
|
||||
// tdf#100011 - Cannot open sheet containing FLOOR/CEILING functions by MS Excel, after export to .xlsx
|
||||
ScDocShellRef xShell = loadDoc(u"ceiling-floor.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/workbook.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
|
||||
@ -3581,7 +3604,8 @@ void ScExportTest::testCustomXml()
|
||||
// Load document and export it to a temporary file
|
||||
ScDocShellRef xShell = loadDoc(u"customxml.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pXmlDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "customXml/item1.xml");
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
@ -3616,7 +3640,7 @@ void ScExportTest::testRelativePathsODS()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"fdo79305.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pTempFile = exportTo(*xDocSh, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pTempFile = exportTo(*xDocSh, FORMAT_ODS);
|
||||
xmlDocUniquePtr pDoc = XPathHelper::parseExport(pTempFile, m_xSFactory, "content.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
OUString aURL = getXPath(pDoc,
|
||||
@ -4527,9 +4551,9 @@ void ScExportTest::testDateStandardfilterXLSX()
|
||||
|
||||
void ScExportTest::testTdf90299()
|
||||
{
|
||||
utl::TempFile aTmpDirectory1(nullptr, true);
|
||||
utl::TempFile aTmpDirectory2(nullptr, true);
|
||||
utl::TempFile aSavedFile(&aTmpDirectory1.GetURL());
|
||||
const OUString aTmpDirectory1URL = utl::CreateTempURL(nullptr, true);
|
||||
const OUString aTmpDirectory2URL = utl::CreateTempURL(nullptr, true);
|
||||
const OUString aSavedFileURL = utl::CreateTempURL(&aTmpDirectory1URL);
|
||||
|
||||
struct
|
||||
{
|
||||
@ -4555,16 +4579,16 @@ void ScExportTest::testTdf90299()
|
||||
OUString aReferencingFileURL;
|
||||
createFileURL(u"tdf90299.", u"xls", aReferencingFileURL);
|
||||
|
||||
auto eError = osl::File::copy(aReferencingFileURL, aTmpDirectory1.GetURL() + "/tdf90299.xls");
|
||||
auto eError = osl::File::copy(aReferencingFileURL, aTmpDirectory1URL + "/tdf90299.xls");
|
||||
CPPUNIT_ASSERT_EQUAL(osl::File::E_None, eError);
|
||||
|
||||
aReferencingFileURL = aTmpDirectory1.GetURL() + "/tdf90299.xls";
|
||||
aReferencedFileURL = aTmpDirectory1.GetURL() + "/dummy.xls";
|
||||
aReferencingFileURL = aTmpDirectory1URL + "/tdf90299.xls";
|
||||
aReferencedFileURL = aTmpDirectory1URL + "/dummy.xls";
|
||||
|
||||
ScDocShellRef xShell = load(aReferencingFileURL, FORMAT_XLS);
|
||||
aCheckShell.checkFormula(xShell, "'" + aReferencedFileURL + "'#$Sheet1.A1");
|
||||
|
||||
aReferencingFileURL = aSavedFile.GetURL();
|
||||
aReferencingFileURL = aSavedFileURL;
|
||||
|
||||
FileFormat afilterFormat = ScBootstrapFixture::getFileFormats()[FORMAT_XLS];
|
||||
OUString aFilterName(afilterFormat.pFilterName, strlen(afilterFormat.pFilterName),
|
||||
@ -4584,11 +4608,11 @@ void ScExportTest::testTdf90299()
|
||||
xShell->DoSaveAs(aStoreMedium);
|
||||
xShell->DoClose();
|
||||
|
||||
eError = osl::File::copy(aReferencingFileURL, aTmpDirectory2.GetURL() + "/tdf90299.xls");
|
||||
eError = osl::File::copy(aReferencingFileURL, aTmpDirectory2URL + "/tdf90299.xls");
|
||||
CPPUNIT_ASSERT_EQUAL(osl::File::E_None, eError);
|
||||
|
||||
aReferencingFileURL = aTmpDirectory2.GetURL() + "/tdf90299.xls";
|
||||
aReferencedFileURL = aTmpDirectory2.GetURL() + "/dummy.xls";
|
||||
aReferencingFileURL = aTmpDirectory2URL + "/tdf90299.xls";
|
||||
aReferencedFileURL = aTmpDirectory2URL + "/dummy.xls";
|
||||
|
||||
xShell = load(aReferencingFileURL, FORMAT_XLS);
|
||||
aCheckShell.checkFormula(xShell, "'" + aReferencedFileURL + "'#$Sheet1.A1");
|
||||
|
@ -804,7 +804,7 @@ void ScExportTest2::testAutofilterColorsOOXML()
|
||||
{
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"autofilter-colors.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable1
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/tables/table1.xml");
|
||||
@ -825,7 +825,7 @@ void ScExportTest2::testAutofilterColorsOOXML()
|
||||
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"autofilter-colors-fg.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pTable1
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/tables/table1.xml");
|
||||
@ -1086,7 +1086,8 @@ void ScExportTest2::testKeepSettingsOfBlankRows()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf41425.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1101,7 +1102,8 @@ void ScExportTest2::testTdf133595()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf133595.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1116,7 +1118,8 @@ void ScExportTest2::testTdf134769()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf134769.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1138,7 +1141,8 @@ void ScExportTest2::testTdf106181()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf106181.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -1274,7 +1278,7 @@ void ScExportTest2::testPivotCacheAfterExportXLSX()
|
||||
ScDocShellRef xDocSh = loadDoc(u"numgroup_example.", FORMAT_ODS);
|
||||
|
||||
// export only
|
||||
std::shared_ptr<utl::TempFile> pTemp = exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pTemp = exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
ScDocument& rDoc = xDocSh->GetDocument();
|
||||
CPPUNIT_ASSERT(rDoc.HasPivotTable());
|
||||
@ -1345,7 +1349,8 @@ void ScExportTest2::testTdf142764()
|
||||
void ScExportTest2::testTdf91634XLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"image_hyperlink.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
@ -1388,7 +1393,8 @@ void ScExportTest2::testValidationCopyPaste()
|
||||
rDestDoc.CopyFromClip(aDstRange, aMark2, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
||||
|
||||
// save as XLSX
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*pShell2, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*pShell2, FORMAT_XLSX);
|
||||
|
||||
// check validation
|
||||
xmlDocUniquePtr pDoc
|
||||
@ -1511,7 +1517,8 @@ void ScExportTest2::testTdf142881()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf142881.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDrawing1
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
CPPUNIT_ASSERT(pDrawing1);
|
||||
@ -1574,7 +1581,8 @@ void ScExportTest2::testTdf112567b()
|
||||
void ScExportTest2::testTdf123645XLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"chart_hyperlink.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
@ -1614,7 +1622,8 @@ void ScExportTest2::testTdf123645XLSX()
|
||||
void ScExportTest2::testTdf125173XLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"text_box_hyperlink.", FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
@ -1635,7 +1644,8 @@ void ScExportTest2::testTdf125173XLSX()
|
||||
void ScExportTest2::testTdf79972XLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf79972.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -1655,7 +1665,8 @@ void ScExportTest2::testTdf79972XLSX()
|
||||
void ScExportTest2::testTdf126024XLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"hyperlink_formula.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -1675,7 +1686,8 @@ void ScExportTest2::testTdf126024XLSX()
|
||||
void ScExportTest2::testTdf126177XLSX()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"hyperlink_export.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -1697,7 +1709,8 @@ void ScExportTest2::testCommentTextVAlignment()
|
||||
// Testing comment text alignments.
|
||||
ScDocShellRef xShell = loadDoc(u"CommentTextVAlign.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pVmlDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/vmlDrawing1.vml");
|
||||
@ -1713,7 +1726,8 @@ void ScExportTest2::testCommentTextHAlignment()
|
||||
// Testing comment text alignments.
|
||||
ScDocShellRef xShell = loadDoc(u"CommentTextHAlign.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pVmlDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/vmlDrawing1.vml");
|
||||
@ -1734,7 +1748,7 @@ void ScExportTest2::testRotatedImageODS()
|
||||
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf103092_RotatedImage.", FORMAT_ODS, true);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pTemp = exportTo(*xDocSh, FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFileNamed> pTemp = exportTo(*xDocSh, FORMAT_ODS);
|
||||
CPPUNIT_ASSERT(pTemp);
|
||||
xmlDocUniquePtr pXmlDoc = XPathHelper::parseExport(pTemp, m_xSFactory, "content.xml");
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
@ -1844,7 +1858,8 @@ void ScExportTest2::testTdf120502()
|
||||
const auto nOldWidth = rDoc.GetColWidth(nMaxCol, 0);
|
||||
rDoc.SetColWidth(nMaxCol, 0, nOldWidth + 100);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet1
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet1);
|
||||
@ -1931,7 +1946,8 @@ void ScExportTest2::testTdf121715_FirstPageHeaderFooterXLSX()
|
||||
// Check if first page header and footer are exported properly
|
||||
ScDocShellRef xShell = loadDoc(u"tdf121715.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -1954,7 +1970,8 @@ void ScExportTest2::testTdf121716_ExportEvenHeaderFooterXLSX()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -2027,7 +2044,8 @@ void ScExportTest2::testTdf121718_UseFirstPageNumberXLSX()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -2088,7 +2106,8 @@ void ScExportTest2::testTdf135828_Shape_Rect()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
@ -2177,7 +2196,8 @@ void ScExportTest2::testTdf123353()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -2195,7 +2215,8 @@ void ScExportTest2::testTdf140098()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
@ -2211,7 +2232,8 @@ void ScExportTest2::testTdf133688_precedents()
|
||||
// tdf#133688 Check that we do not export detective shapes.
|
||||
ScDocShellRef xShell = loadDoc(u"tdf133688_dont_save_precedents_to_xlsx.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
CPPUNIT_ASSERT(pDrawing);
|
||||
@ -2229,7 +2251,8 @@ void ScExportTest2::testTdf91251_missingOverflowRoundtrip()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
@ -2249,7 +2272,8 @@ void ScExportTest2::testTdf137000_handle_upright()
|
||||
// of workaround 'rot'.
|
||||
ScDocShellRef xShell = loadDoc(u"tdf137000_export_upright.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
CPPUNIT_ASSERT(pDrawing);
|
||||
@ -2264,7 +2288,8 @@ void ScExportTest2::testTdf126305_DataValidatyErrorAlert()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -2319,8 +2344,7 @@ void ScExportTest2::testTdf87973_externalLinkSkipUnuseds()
|
||||
|
||||
// saveAndReload save the file to a temporary directory
|
||||
// the link must be changed to point to that directory
|
||||
utl::TempFile aTempFile;
|
||||
auto aTempFilename = aTempFile.GetURL();
|
||||
OUString aTempFilename = utl::CreateTempURL();
|
||||
auto nIdxOfTmpFile = aTempFilename.lastIndexOf('/');
|
||||
aTempFilename = aTempFilename.copy(0, nIdxOfTmpFile + 1);
|
||||
|
||||
@ -2396,8 +2420,7 @@ void ScExportTest2::testTdf138824_linkToParentDirectory()
|
||||
|
||||
// saveAndReload save the file to a temporary directory
|
||||
// the link must be changed to point to that parent directory
|
||||
utl::TempFile aTempFile;
|
||||
auto aTempFilename = aTempFile.GetURL();
|
||||
OUString aTempFilename = utl::CreateTempURL();
|
||||
auto nIdxOfTmpFile = aTempFilename.lastIndexOf('/');
|
||||
nIdxOfTmpFile = aTempFilename.lastIndexOf('/', nIdxOfTmpFile);
|
||||
aTempFilename = aTempFilename.copy(0, nIdxOfTmpFile + 1);
|
||||
@ -2413,7 +2436,8 @@ void ScExportTest2::testTdf138824_linkToParentDirectory()
|
||||
ScDocShellRef xDocSh = saveAndReload(*xShell, FORMAT_XLSX);
|
||||
CPPUNIT_ASSERT(xDocSh.is());
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc = XPathHelper::parseExport(
|
||||
pXPathFile, m_xSFactory, "xl/externalLinks/_rels/externalLink1.xml.rels");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -2493,7 +2517,8 @@ void ScExportTest2::testTdf136721_paper_size()
|
||||
{
|
||||
ScDocShellRef xShell = loadDoc(u"tdf136721_letter_sized_paper.", FORMAT_XLSX);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pDoc
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
@ -2506,7 +2531,8 @@ void ScExportTest2::testTdf139258_rotated_image()
|
||||
// Check that the topleft position of the image is correct.
|
||||
ScDocShellRef xShell = loadDoc(u"tdf139258_rotated_image.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
|
||||
xmlDocUniquePtr pDrawing
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
|
||||
@ -2592,7 +2618,8 @@ void ScExportTest2::testCheckboxFormControlXlsxExport()
|
||||
ScDocShellRef xShell = loadDoc(u"checkbox-form-control.", FORMAT_XLSX);
|
||||
|
||||
// When exporting to XLSX:
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
|
||||
// Then make sure its VML markup is written and it has a correct position + size:
|
||||
xmlDocUniquePtr pDoc
|
||||
@ -2608,7 +2635,8 @@ void ScExportTest2::testButtonFormControlXlsxExport()
|
||||
ScDocShellRef xShell = loadDoc(u"button-form-control.", FORMAT_XLSX);
|
||||
|
||||
// When exporting to XLSX:
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX);
|
||||
|
||||
// Then make sure its control markup is written and it has a correct position + size:
|
||||
xmlDocUniquePtr pDoc
|
||||
@ -2898,7 +2926,8 @@ void ScExportTest2::testTdf142578()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf142578.", FORMAT_ODS);
|
||||
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -2936,7 +2965,8 @@ void ScExportTest2::testTdf145059()
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf145059.", FORMAT_ODS);
|
||||
|
||||
// Export to xlsx.
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -2963,7 +2993,8 @@ void ScExportTest2::testTdf130104_XLSXIndent()
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf130104_indent.", FORMAT_XLSX);
|
||||
|
||||
// Resave the xlsx file without any modification.
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
@ -3086,7 +3117,7 @@ void ScExportTest2::testXlsxRowsOrder()
|
||||
void ScExportTest2::testTdf91286()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf91286.", FORMAT_ODS);
|
||||
std::shared_ptr<utl::TempFile> pTemp = exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pTemp = exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xDocSh->DoClose();
|
||||
|
||||
Reference<packages::zip::XZipFileAccess2> xNameAccess
|
||||
@ -3108,7 +3139,8 @@ void ScExportTest2::testTdf91286()
|
||||
void ScExportTest2::testTdf148820()
|
||||
{
|
||||
ScDocShellRef xDocSh = loadDoc(u"tdf148820.", FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
std::shared_ptr<utl::TempFileNamed> pXPathFile
|
||||
= ScBootstrapFixture::exportTo(*xDocSh, FORMAT_XLSX);
|
||||
xmlDocUniquePtr pSheet
|
||||
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
|
||||
CPPUNIT_ASSERT(pSheet);
|
||||
|
@ -206,7 +206,7 @@ private:
|
||||
|
||||
uno::Reference<lang::XComponent> mxComponent;
|
||||
TestLokCallbackWrapper m_callbackWrapper;
|
||||
std::unique_ptr<utl::TempFile> mpTempFile;
|
||||
std::unique_ptr<utl::TempFileNamed> mpTempFile;
|
||||
};
|
||||
|
||||
ScTiledRenderingTest::ScTiledRenderingTest()
|
||||
@ -249,7 +249,7 @@ void ScTiledRenderingTest::tearDown()
|
||||
|
||||
void ScTiledRenderingTest::makeTempCopy(const OUString& rOrigURL)
|
||||
{
|
||||
mpTempFile.reset(new utl::TempFile());
|
||||
mpTempFile.reset(new utl::TempFileNamed());
|
||||
mpTempFile->EnableKillingFile();
|
||||
auto const aError = osl::File::copy(rOrigURL, mpTempFile->GetURL());
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
|
@ -48,8 +48,8 @@ public:
|
||||
virtual void tearDown() override;
|
||||
|
||||
ScModelObj* createDoc(const char* pName);
|
||||
utl::TempFile save(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter);
|
||||
utl::TempFileNamed save(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter);
|
||||
ScModelObj* saveAndReload(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter);
|
||||
void goToCell(const OUString& rCell);
|
||||
@ -170,10 +170,10 @@ ScModelObj* ScUiCalcTest::createDoc(const char* pName)
|
||||
return pModelObj;
|
||||
}
|
||||
|
||||
utl::TempFile ScUiCalcTest::save(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter)
|
||||
utl::TempFileNamed ScUiCalcTest::save(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter)
|
||||
{
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
css::uno::Sequence aArgs{ comphelper::makePropertyValue("FilterName", rFilter) };
|
||||
css::uno::Reference<css::frame::XStorable> xStorable(xComponent, css::uno::UNO_QUERY_THROW);
|
||||
@ -187,7 +187,7 @@ utl::TempFile ScUiCalcTest::save(css::uno::Reference<css::lang::XComponent>& xCo
|
||||
ScModelObj* ScUiCalcTest::saveAndReload(css::uno::Reference<css::lang::XComponent>& xComponent,
|
||||
const OUString& rFilter)
|
||||
{
|
||||
utl::TempFile aTempFile = save(xComponent, rFilter);
|
||||
utl::TempFileNamed aTempFile = save(xComponent, rFilter);
|
||||
|
||||
mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.sheet.SpreadsheetDocument");
|
||||
|
||||
@ -205,7 +205,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100847)
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
|
||||
// Save the document
|
||||
utl::TempFile aTempFile = save(mxComponent, "calc8");
|
||||
utl::TempFileNamed aTempFile = save(mxComponent, "calc8");
|
||||
|
||||
// Open a new document
|
||||
mxComponent = loadFromDesktop("private:factory/scalc");
|
||||
@ -240,7 +240,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences)
|
||||
insertStringToCell(*pModelObj, "D3", u"FISHY");
|
||||
|
||||
// Save the document
|
||||
utl::TempFile aTempFile = save(mxComponent, "calc8");
|
||||
utl::TempFileNamed aTempFile = save(mxComponent, "calc8");
|
||||
|
||||
// Open a new document
|
||||
mxComponent = loadFromDesktop("private:factory/scalc");
|
||||
@ -348,7 +348,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994)
|
||||
insertStringToCell(*pModelObj, "B1", u"2");
|
||||
|
||||
// Save the document
|
||||
utl::TempFile aTempFile = save(mxComponent, "calc8");
|
||||
utl::TempFileNamed aTempFile = save(mxComponent, "calc8");
|
||||
|
||||
// Open a new document
|
||||
mxComponent = loadFromDesktop("private:factory/scalc");
|
||||
@ -392,7 +392,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf113541)
|
||||
insertStringToCell(*pModelObj, "A1", u"50");
|
||||
|
||||
// Save the document
|
||||
utl::TempFile aTempFile = save(mxComponent, "calc8");
|
||||
utl::TempFileNamed aTempFile = save(mxComponent, "calc8");
|
||||
|
||||
// Open a new document
|
||||
mxComponent = loadFromDesktop("private:factory/scalc");
|
||||
|
@ -2017,7 +2017,6 @@ void XclExpObjectManager::InitStream( bool bTempFile )
|
||||
if( bTempFile )
|
||||
{
|
||||
moTempFile.emplace();
|
||||
moTempFile->EnableKillingFile();
|
||||
mpDffStrm = moTempFile->GetStream( StreamMode::STD_READWRITE );
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ private:
|
||||
virtual SvStream* ImplQueryPictureStream() override;
|
||||
|
||||
private:
|
||||
::std::unique_ptr< ::utl::TempFile > mxPicTempFile;
|
||||
::std::unique_ptr< ::utl::TempFileFast > mxPicTempFile;
|
||||
SvStream* mpPicStrm;
|
||||
};
|
||||
|
||||
|
@ -438,7 +438,7 @@ private:
|
||||
void InitStream( bool bTempFile );
|
||||
|
||||
private:
|
||||
std::optional< ::utl::TempFile > moTempFile;
|
||||
std::optional< ::utl::TempFileFast > moTempFile;
|
||||
SvStream* mpDffStrm = nullptr;
|
||||
std::unique_ptr<SvMemoryStream> mpBackupStrm;
|
||||
std::shared_ptr< XclEscherEx > mxEscherEx;
|
||||
|
@ -75,8 +75,7 @@ XclEscherExGlobal::XclEscherExGlobal( const XclExpRoot& rRoot )
|
||||
|
||||
SvStream* XclEscherExGlobal::ImplQueryPictureStream()
|
||||
{
|
||||
mxPicTempFile.reset( new ::utl::TempFile );
|
||||
mxPicTempFile->EnableKillingFile();
|
||||
mxPicTempFile.reset( new ::utl::TempFileFast );
|
||||
mpPicStrm = mxPicTempFile->GetStream( StreamMode::READWRITE );
|
||||
mpPicStrm->SetEndian( SvStreamEndian::LITTLE );
|
||||
return mpPicStrm;
|
||||
|
@ -470,8 +470,7 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void*
|
||||
// impl. for "single OLE"
|
||||
embed::XEmbeddedObject* pEmbObj = static_cast<embed::XEmbeddedObject*>(pUserObject);
|
||||
|
||||
::utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
::utl::TempFileFast aTempFile;
|
||||
SvStream* pTempStream = aTempFile.GetStream(StreamMode::READWRITE);
|
||||
uno::Reference< embed::XStorage > xWorkStore =
|
||||
::comphelper::OStorageHelper::GetStorageFromStream( new utl::OStreamWrapper(*pTempStream) );
|
||||
@ -515,8 +514,7 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void*
|
||||
|
||||
try
|
||||
{
|
||||
::utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
::utl::TempFileFast aTempFile;
|
||||
SvStream* pTempStream = aTempFile.GetStream(StreamMode::READWRITE);
|
||||
uno::Reference< embed::XStorage > xWorkStore =
|
||||
::comphelper::OStorageHelper::GetStorageFromStream( new utl::OStreamWrapper(*pTempStream) );
|
||||
|
@ -508,8 +508,7 @@ bool ScTransferObj::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUse
|
||||
{
|
||||
// TODO/MBA: testing
|
||||
SfxObjectShell* pEmbObj = static_cast<SfxObjectShell*>(pUserObject);
|
||||
::utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
::utl::TempFileFast aTempFile;
|
||||
SvStream* pTempStream = aTempFile.GetStream(StreamMode::READWRITE);
|
||||
uno::Reference< embed::XStorage > xWorkStore =
|
||||
::comphelper::OStorageHelper::GetStorageFromStream( new utl::OStreamWrapper(*pTempStream) );
|
||||
|
@ -3432,11 +3432,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDBF(SvStream &rStream)
|
||||
// we need a real file for this filter
|
||||
|
||||
// put it in an empty dir
|
||||
utl::TempFile aTmpDir(nullptr, true);
|
||||
utl::TempFileNamed aTmpDir(nullptr, true);
|
||||
aTmpDir.EnableKillingFile();
|
||||
OUString sTmpDir = aTmpDir.GetURL();
|
||||
|
||||
utl::TempFile aTempInput(u"", true, u".dbf", &sTmpDir);
|
||||
utl::TempFileNamed aTempInput(u"", true, u".dbf", &sTmpDir);
|
||||
aTempInput.EnableKillingFile();
|
||||
|
||||
SvStream* pInputStream = aTempInput.GetStream(StreamMode::WRITE);
|
||||
|
@ -66,7 +66,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOOXMLCustomShapeBitmapFill)
|
||||
// Save the bugdoc to PPT.
|
||||
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "custom-shape-bitmap-fill.pptx";
|
||||
getComponent() = loadFromDesktop(aURL);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport)
|
||||
xMasterPage->setPropertyValue("Theme", aTheme);
|
||||
|
||||
// When exporting to PPTX:
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OUString("Impress Office Open XML");
|
||||
@ -133,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation)
|
||||
getComponent() = loadFromDesktop(aURL);
|
||||
|
||||
// When exporting that to PPTX:
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OUString("Impress Office Open XML");
|
||||
|
@ -21,7 +21,7 @@ private:
|
||||
{
|
||||
FileFormat* pFormat = getFormat(HTML);
|
||||
OUString aExt = "." + OUString::createFromAscii(pFormat->pName);
|
||||
utl::TempFile aTempFile(u"", true, aExt);
|
||||
utl::TempFileNamed aTempFile(u"", true, aExt);
|
||||
aTempFile.EnableKillingFile();
|
||||
exportTo(xDocShRef.get(), pFormat, aTempFile);
|
||||
return parseHtml(aTempFile);
|
||||
|
@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998)
|
||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||
= drawing::GraphicExportFilter::create(xContext);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -127,7 +127,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
|
||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||
= drawing::GraphicExportFilter::create(xContext);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -201,7 +201,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632)
|
||||
uno::Sequence<beans::PropertyValue> aFilterData{ comphelper::makePropertyValue("Translucent",
|
||||
sal_Int32(0)) };
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -241,7 +241,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163)
|
||||
comphelper::makePropertyValue("PixelHeight", sal_Int32(100))
|
||||
};
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -296,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119)
|
||||
comphelper::makePropertyValue("Translucent", sal_Int32(1)),
|
||||
};
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -348,7 +348,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113197)
|
||||
comphelper::makePropertyValue("PixelHeight", sal_Int32(100)),
|
||||
};
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -403,7 +403,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf93124)
|
||||
comphelper::makePropertyValue("PixelHeight", sal_Int32(180))
|
||||
};
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
@ -466,7 +466,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729)
|
||||
comphelper::makePropertyValue("PixelHeight", sal_Int32(240))
|
||||
};
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aDescriptor{
|
||||
|
@ -96,7 +96,7 @@ class SdSVGFilterTest : public test::BootstrapFixture, public unotest::MacrosTes
|
||||
};
|
||||
|
||||
uno::Reference<lang::XComponent> mxComponent;
|
||||
utl::TempFile maTempFile;
|
||||
utl::TempFileNamed maTempFile;
|
||||
|
||||
protected:
|
||||
void load(std::u16string_view pDir, const char* pName)
|
||||
|
@ -231,7 +231,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport)
|
||||
}
|
||||
|
||||
{ // save as PDF and check annotations
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
|
||||
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
|
||||
|
@ -262,7 +262,7 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export()
|
||||
::sd::DrawDocShellRef xDocShell
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/TextDistancesInsets3.pptx"), PPTX);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShell = saveAndReload(xDocShell.get(), PPTX, &aTempFile);
|
||||
xDocShell->DoClose();
|
||||
|
||||
|
@ -225,7 +225,7 @@ void SdOOXMLExportTest1::testTdf149311()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf149311.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -239,7 +239,7 @@ void SdOOXMLExportTest1::testTdf149128()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf149128.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -254,7 +254,7 @@ void SdOOXMLExportTest1::testTdf66228()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf66228.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -267,7 +267,7 @@ void SdOOXMLExportTest1::testTdf147919()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf147919.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -327,7 +327,7 @@ void SdOOXMLExportTest1::testTdf130165()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf146223.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -339,7 +339,7 @@ void SdOOXMLExportTest1::testTdf124781()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf124781.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -356,7 +356,7 @@ void SdOOXMLExportTest1::testTdf144914()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf144616.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -398,7 +398,7 @@ void SdOOXMLExportTest1::testTdf144914()
|
||||
void SdOOXMLExportTest1::testTdf124232()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf141704.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -440,7 +440,7 @@ void SdOOXMLExportTest1::testTdf124232()
|
||||
void SdOOXMLExportTest1::testTdf143624()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143624.pptx"), PPTX );
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -454,7 +454,7 @@ void SdOOXMLExportTest1::testTdf143624()
|
||||
void SdOOXMLExportTest1::testTdf142648()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142648.pptx"), PPTX );
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
|
||||
uno::Reference<drawing::XDrawPagesSupplier> xDPS(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
|
||||
uno::Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
|
||||
@ -475,7 +475,7 @@ void SdOOXMLExportTest1::testTdf142648()
|
||||
void SdOOXMLExportTest1::testTdf47365()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/loopNoPause.pptx"), PPTX );
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -489,7 +489,7 @@ void SdOOXMLExportTest1::testTdf47365()
|
||||
void SdOOXMLExportTest1::testTdf125071()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf125071.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -502,7 +502,7 @@ void SdOOXMLExportTest1::testTdf125071()
|
||||
void SdOOXMLExportTest1::testTdf54037()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf54037.pptx"), PPTX );
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -938,7 +938,7 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(aFileFormats[PPTX].pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent.set(xStorable, uno::UNO_QUERY);
|
||||
@ -1274,7 +1274,7 @@ void SdOOXMLExportTest1::testTdf112633()
|
||||
{
|
||||
// Load document and export it to a temporary file
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112633.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1301,7 +1301,7 @@ void SdOOXMLExportTest1::testTdf112633()
|
||||
void SdOOXMLExportTest1::testTdf128952()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf128952.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1316,7 +1316,7 @@ void SdOOXMLExportTest1::testTdf128952()
|
||||
void SdOOXMLExportTest1::testTdf127090()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf127090.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1329,7 +1329,7 @@ void SdOOXMLExportTest1::testCustomXml()
|
||||
{
|
||||
// Load document and export it to a temporary file
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/customxml.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1351,7 +1351,7 @@ void SdOOXMLExportTest1::testTdf94238()
|
||||
// Load document and export it to a temporary file.
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf94238.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
|
||||
uno::UNO_QUERY);
|
||||
@ -1389,7 +1389,7 @@ void SdOOXMLExportTest1::testPictureTransparency()
|
||||
// Load document and export it to a temporary file.
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/image_transparency.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
|
||||
uno::UNO_QUERY);
|
||||
@ -1443,7 +1443,7 @@ void SdOOXMLExportTest1::testRoundtripOwnLineStyles()
|
||||
}
|
||||
|
||||
// Save to pptx, reload and compare the LineDash values
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
uno::Reference<drawing::XDrawPagesSupplier> xDocpptx(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xDocpptx.is());
|
||||
@ -1472,7 +1472,7 @@ void SdOOXMLExportTest1::testRoundtripPrstDash()
|
||||
// load and save document, compare prstDash values in saved document with original.
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/presetDashDot.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
const OUString sOriginal[] = {
|
||||
@ -1522,7 +1522,7 @@ void SdOOXMLExportTest1::testDashOnHairline()
|
||||
// load and save document, make sure the custDash has 11 child elements.
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf127267DashOnHairline.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1534,7 +1534,7 @@ void SdOOXMLExportTest1::testNarrationNonMediaShape()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/narration-non-media-shape.pptx"), PPTX);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
// Without the accompanying fix in place, this test would have failed,
|
||||
// beans::UnknownPropertyException was thrown.
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
|
||||
@ -1546,7 +1546,7 @@ void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect()
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/customshape-bitmapfill-srcrect.pptx"),
|
||||
PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1582,7 +1582,7 @@ void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1598,7 +1598,7 @@ void SdOOXMLExportTest1::testTdf100348FontworkGradientGlow()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1615,7 +1615,7 @@ void SdOOXMLExportTest1::testTdf128345FullTransparentGradient()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_FullTransparentGradient.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1628,7 +1628,7 @@ void SdOOXMLExportTest1::testTdf128345GradientLinear()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientLinear.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1649,7 +1649,7 @@ void SdOOXMLExportTest1::testTdf128345GradientRadial()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientRadial.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1686,7 +1686,7 @@ void SdOOXMLExportTest1::testTdf134969TransparencyOnColorGradient()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf134969_TransparencyOnColorGradient.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1702,7 +1702,7 @@ void SdOOXMLExportTest1::testArcTo()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/arc-validiert.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1718,7 +1718,7 @@ void SdOOXMLExportTest1::testNarrationMimeType()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/narration.pptx"), PPTX);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "[Content_Types].xml");
|
||||
// Without the accompanying fix in place, this test would have failed with:
|
||||
@ -1783,7 +1783,7 @@ void SdOOXMLExportTest1::testTdf140865Wordart3D()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf140865Wordart3D.pptx"), PPTX);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "ppt/slides/slide1.xml");
|
||||
|
||||
@ -1804,7 +1804,7 @@ void SdOOXMLExportTest1::testTdf140865Wordart3D()
|
||||
void SdOOXMLExportTest1::testTdf124457()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf124457.pptx"), PPTX );
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1824,7 +1824,7 @@ void SdOOXMLExportTest1::testTdf124457()
|
||||
void SdOOXMLExportTest1::testTdf143126()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143126.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1838,7 +1838,7 @@ void SdOOXMLExportTest1::testTdf143126()
|
||||
void SdOOXMLExportTest1::testTdf143129()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143129.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1852,7 +1852,7 @@ void SdOOXMLExportTest1::testTdf118045()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf118045.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1865,7 +1865,7 @@ void SdOOXMLExportTest1::testTdf137675()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf137675.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
|
@ -218,7 +218,7 @@ void SdOOXMLExportTest2::testTdf149697()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149697.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -241,7 +241,7 @@ void SdOOXMLExportTest2::testTdf149126()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf149126.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -255,7 +255,7 @@ void SdOOXMLExportTest2::testTdf131905()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf131905.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -291,7 +291,7 @@ void SdOOXMLExportTest2::testBnc822341()
|
||||
{
|
||||
// Check import / export of embedded text document
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/bnc822341.odp"), ODP);
|
||||
utl::TempFile tempFile1;
|
||||
utl::TempFileNamed tempFile1;
|
||||
xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile1 );
|
||||
|
||||
// Export an LO specific ole object (imported from an ODP document)
|
||||
@ -321,7 +321,7 @@ void SdOOXMLExportTest2::testBnc822341()
|
||||
CPPUNIT_ASSERT_EQUAL( SdrObjKind::OLE2, pObj->GetObjIdentifier() );
|
||||
}
|
||||
|
||||
utl::TempFile tempFile2;
|
||||
utl::TempFileNamed tempFile2;
|
||||
xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile2 );
|
||||
|
||||
// Export an MS specific ole object (imported from a PPTX document)
|
||||
@ -361,7 +361,7 @@ void SdOOXMLExportTest2::testMathObject()
|
||||
{
|
||||
// Check import / export of math object
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/math.odp"), ODP);
|
||||
utl::TempFile tempFile1;
|
||||
utl::TempFileNamed tempFile1;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile1);
|
||||
|
||||
// Export an LO specific ole object (imported from an ODP document)
|
||||
@ -381,7 +381,7 @@ void SdOOXMLExportTest2::testMathObject()
|
||||
CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier());
|
||||
}
|
||||
|
||||
utl::TempFile tempFile2;
|
||||
utl::TempFileNamed tempFile2;
|
||||
xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile2 );
|
||||
|
||||
// Export an MS specific ole object (imported from a PPTX document)
|
||||
@ -408,7 +408,7 @@ void SdOOXMLExportTest2::testMathObjectPPT2010()
|
||||
{
|
||||
// Check import / export of math object
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/Math.pptx"), PPTX);
|
||||
utl::TempFile tempFile1;
|
||||
utl::TempFileNamed tempFile1;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile1);
|
||||
|
||||
// Export an MS specific ole object (imported from a PPTX document)
|
||||
@ -738,7 +738,7 @@ void SdOOXMLExportTest2::testPresetShapesExport()
|
||||
"adj3","val 3770",
|
||||
};
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile );
|
||||
|
||||
xmlDocUniquePtr pXmlDocCT = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -988,7 +988,7 @@ void SdOOXMLExportTest2::testTdf92076()
|
||||
void SdOOXMLExportTest2::testTdf59046()
|
||||
{
|
||||
sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf59046.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
|
||||
xShell->DoClose();
|
||||
xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -998,7 +998,7 @@ void SdOOXMLExportTest2::testTdf59046()
|
||||
void SdOOXMLExportTest2::testTdf133502()
|
||||
{
|
||||
sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf133502.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
|
||||
xShell->DoClose();
|
||||
xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/comments/comment1.xml");
|
||||
@ -1014,7 +1014,7 @@ void SdOOXMLExportTest2::testTdf105739()
|
||||
{
|
||||
// Gradient was lost during saving to ODP
|
||||
sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf105739.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xShell = saveAndReload(xShell.get(), ODP, &tempFile);
|
||||
uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
|
||||
uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
|
||||
@ -1069,7 +1069,7 @@ void SdOOXMLExportTest2::testPageBitmapWithTransparency()
|
||||
void SdOOXMLExportTest2::testPptmContentType()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptm/macro.pptm"), PPTM);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTM, &tempFile);
|
||||
|
||||
// Assert that the content type is the one of PPTM
|
||||
@ -1085,7 +1085,7 @@ void SdOOXMLExportTest2::testPptmContentType()
|
||||
void SdOOXMLExportTest2::testTdf111798()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf111798.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1130,7 +1130,7 @@ void SdOOXMLExportTest2::testTdf111798()
|
||||
void SdOOXMLExportTest2::testPptmVBAStream()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptm/macro.pptm"), PPTM);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTM, &tempFile);
|
||||
|
||||
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
|
||||
@ -1143,7 +1143,7 @@ void SdOOXMLExportTest2::testPptmVBAStream()
|
||||
void SdOOXMLExportTest2::testTdf111863()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf111863.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1156,7 +1156,7 @@ void SdOOXMLExportTest2::testTdf111863()
|
||||
void SdOOXMLExportTest2::testTdf111518()
|
||||
{
|
||||
sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf111518.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
tempFile.EnableKillingFile(false);
|
||||
xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
|
||||
xShell->DoClose();
|
||||
@ -1172,7 +1172,7 @@ void SdOOXMLExportTest2::testTdf100387()
|
||||
{
|
||||
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf100387.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1201,7 +1201,7 @@ void SdOOXMLExportTest2::testTdf100387()
|
||||
void SdOOXMLExportTest2::testClosingShapesAndLineCaps()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/closed-shapes.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1236,7 +1236,7 @@ void SdOOXMLExportTest2::testClosingShapesAndLineCaps()
|
||||
void SdOOXMLExportTest2::testRotateFlip()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/rotate_flip.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1282,7 +1282,7 @@ void SdOOXMLExportTest2::testRotateFlip()
|
||||
void SdOOXMLExportTest2::testTdf106867()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf106867.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
const SdrPage *pPage = GetPage(1, xDocShRef.get());
|
||||
@ -1312,7 +1312,7 @@ void SdOOXMLExportTest2::testTdf106867()
|
||||
void SdOOXMLExportTest2::testTdf112280()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112280.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1325,7 +1325,7 @@ void SdOOXMLExportTest2::testTdf112280()
|
||||
void SdOOXMLExportTest2::testTdf112088()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112088.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1337,7 +1337,7 @@ void SdOOXMLExportTest2::testTdf112088()
|
||||
void SdOOXMLExportTest2::testTdf112333()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112333.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1366,7 +1366,7 @@ void SdOOXMLExportTest2::testTdf112552()
|
||||
{
|
||||
// Background fill was not displayed, but it was because of the wrong geometry
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf112552.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1381,7 +1381,7 @@ void SdOOXMLExportTest2::testTdf112557()
|
||||
{
|
||||
// Subtitle shape should be skipped by export.
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf112557.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
|
||||
@ -1392,7 +1392,7 @@ void SdOOXMLExportTest2::testTdf112557()
|
||||
void SdOOXMLExportTest2::testTdf128049()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf128049.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1406,7 +1406,7 @@ void SdOOXMLExportTest2::testTdf128049()
|
||||
void SdOOXMLExportTest2::testTdf106026()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf106026.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlMasterContent = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
|
||||
@ -1431,7 +1431,7 @@ void SdOOXMLExportTest2::testTdf106026()
|
||||
void SdOOXMLExportTest2::testTdf112334()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112334.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1444,7 +1444,7 @@ void SdOOXMLExportTest2::testTdf112334()
|
||||
void SdOOXMLExportTest2::testTdf112089()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112089.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1458,7 +1458,7 @@ void SdOOXMLExportTest2::testTdf112089()
|
||||
void SdOOXMLExportTest2::testTdf112086()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112086.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1496,7 +1496,7 @@ void SdOOXMLExportTest2::testTdf112647()
|
||||
void SdOOXMLExportTest2::testGroupRotation()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/group_rotation.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1509,7 +1509,7 @@ void SdOOXMLExportTest2::testGroupRotation()
|
||||
void SdOOXMLExportTest2::testTdf104788()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf104788.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1535,7 +1535,7 @@ void SdOOXMLExportTest2::testSmartartRotation2()
|
||||
uno::Sequence<beans::PropertyValue> aInteropGrabBag;
|
||||
xShape->setPropertyValue("InteropGrabBag", uno::Any(aInteropGrabBag));
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1552,7 +1552,7 @@ void SdOOXMLExportTest2::testSmartartRotation2()
|
||||
void SdOOXMLExportTest2::testTdf91999_rotateShape()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf91999_rotateShape.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1568,7 +1568,7 @@ void SdOOXMLExportTest2::testTdf91999_rotateShape()
|
||||
void SdOOXMLExportTest2::testTdf114845_rotateShape()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf114845_rotateShape.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1584,7 +1584,7 @@ void SdOOXMLExportTest2::testTdf114845_rotateShape()
|
||||
void SdOOXMLExportTest2::testGroupsPosition()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/group.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1598,7 +1598,7 @@ void SdOOXMLExportTest2::testGroupsPosition()
|
||||
void SdOOXMLExportTest2::testGroupsRotatedPosition()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/group-rot.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1610,7 +1610,7 @@ void SdOOXMLExportTest2::testGroupsRotatedPosition()
|
||||
void SdOOXMLExportTest2::testAccentColor()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/accent-color.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1634,7 +1634,7 @@ void SdOOXMLExportTest2::testAccentColor()
|
||||
void SdOOXMLExportTest2::testThemeColors()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf84205.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1646,7 +1646,7 @@ void SdOOXMLExportTest2::testThemeColors()
|
||||
void SdOOXMLExportTest2::testTdf111785()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf111785.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1661,7 +1661,7 @@ void SdOOXMLExportTest2::testTdf111785()
|
||||
void SdOOXMLExportTest2::testTdf118825()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf118825-motionpath.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
|
||||
@ -1701,7 +1701,7 @@ void SdOOXMLExportTest2::testTextColumns_tdf140852()
|
||||
xColProps->getPropertyValue("AutomaticDistance"));
|
||||
}
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
{
|
||||
@ -1757,7 +1757,7 @@ void SdOOXMLExportTest2::testTextColumns_3columns()
|
||||
CPPUNIT_ASSERT_LESS(sal_Int16(100), nScale);
|
||||
}
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
{
|
||||
@ -1794,7 +1794,7 @@ void SdOOXMLExportTest2::testTdf59323_slideFooters()
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf59323.pptx"), PPTX);
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
|
||||
@ -1851,7 +1851,7 @@ void SdOOXMLExportTest2::testTdf53970()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf53970_linked.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlRels = parseExport(tempFile, "ppt/slides/_rels/slide1.xml.rels");
|
||||
|
@ -224,7 +224,7 @@ void SdOOXMLExportTest3::testTdf129430()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf129430.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -237,7 +237,7 @@ void SdOOXMLExportTest3::testTdf114848()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf114848.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -253,7 +253,7 @@ void SdOOXMLExportTest3::testTdf147586()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf147586.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -273,7 +273,7 @@ void SdOOXMLExportTest3::testTdf68759()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf68759.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -299,7 +299,7 @@ void SdOOXMLExportTest3::testTdf127901()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf127901.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -321,7 +321,7 @@ void SdOOXMLExportTest3::testTdf48735()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf48735.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -336,7 +336,7 @@ void SdOOXMLExportTest3::testTdf90626()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf90626.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -355,7 +355,7 @@ void SdOOXMLExportTest3::testTdf107608()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf107608.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -381,7 +381,7 @@ void SdOOXMLExportTest3::testTdf111786()
|
||||
// Export line transparency with the color
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf111786.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -402,7 +402,7 @@ void SdOOXMLExportTest3::testFontScale()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/font-scale.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
|
||||
@ -418,7 +418,7 @@ void SdOOXMLExportTest3::testShapeAutofitPPTX()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/testShapeAutofit.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
CPPUNIT_ASSERT(pXmlDocContent);
|
||||
@ -433,7 +433,7 @@ void SdOOXMLExportTest3::testLegacyShapeAutofitPPTX()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/testLegacyShapeAutofit.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
CPPUNIT_ASSERT(pXmlDocContent);
|
||||
@ -450,7 +450,7 @@ void SdOOXMLExportTest3::testTdf115394()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf115394.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
double fTransitionDuration;
|
||||
|
||||
@ -485,7 +485,7 @@ void SdOOXMLExportTest3::testTdf115394Zero()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf115394-zero.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
double fTransitionDuration;
|
||||
|
||||
@ -500,7 +500,7 @@ void SdOOXMLExportTest3::testTdf115005()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRefOriginal
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf115005.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRefResaved = saveAndReload(xDocShRefOriginal.get(), ODP, &tempFile);
|
||||
|
||||
// additional checks of the output file
|
||||
@ -536,7 +536,7 @@ int SdOOXMLExportTest3::testTdf115005_FallBack_Images(bool bAddReplacementImages
|
||||
}
|
||||
|
||||
// save the file with already set options
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRefResaved = saveAndReload(xDocShRefOriginal.get(), ODP, &tempFile);
|
||||
|
||||
// additional checks of the output file
|
||||
@ -577,7 +577,7 @@ void SdOOXMLExportTest3::testTdf118806()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf118806.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -590,7 +590,7 @@ void SdOOXMLExportTest3::testTdf130058()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf130058.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -623,7 +623,7 @@ void SdOOXMLExportTest3::testTdf111789()
|
||||
// Shadow properties were not exported for text shapes.
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf111789.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// First text shape has some shadow
|
||||
@ -666,7 +666,7 @@ void SdOOXMLExportTest3::testTdf145162()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf145162.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
|
||||
@ -681,7 +681,7 @@ void SdOOXMLExportTest3::testZeroIndentExport()
|
||||
// Load the bugdoc and save to pptx then.
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/testZeroIndent.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
// There are 3 slides, get them
|
||||
xmlDocUniquePtr pSlide1 = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -716,7 +716,7 @@ void SdOOXMLExportTest3::testTdf100348_convert_Fontwork2TextWarp()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf100348_Fontwork2TextWarp.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// Resulting pptx has to contain the TextWarp shape
|
||||
@ -772,7 +772,7 @@ void SdOOXMLExportTest3::testTdf1225573_FontWorkScaleX()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf125573_FontWorkScaleX.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// Error was, that attribute 'fromWordArt' was ignored
|
||||
@ -807,7 +807,7 @@ void SdOOXMLExportTest3::testTdf99497_keepAppearanceOfCircleKind()
|
||||
// original angles. Shape 'arc' needs to be unfilled.
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf99497_CircleKind.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// slide 1 45° -> adj1 = 20493903, 270° -> adj2 = 5400000, <a:noFill/> exists
|
||||
@ -843,7 +843,7 @@ void SdOOXMLExportTest3::testTdf104792()
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx"),
|
||||
PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -860,7 +860,7 @@ void SdOOXMLExportTest3::testTdf90627()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf90627.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -878,7 +878,7 @@ void SdOOXMLExportTest3::testTdf104786()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf104786.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide2.xml");
|
||||
@ -896,7 +896,7 @@ void SdOOXMLExportTest3::testTdf118783()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf118783.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -911,7 +911,7 @@ void SdOOXMLExportTest3::testTdf104789()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf104789.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -929,7 +929,7 @@ void SdOOXMLExportTest3::testOpenDocumentAsReadOnly()
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/open-as-read-only.pptx"), PPTX);
|
||||
CPPUNIT_ASSERT(xDocShRef->IsSecurityOptOpenReadOnly());
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
CPPUNIT_ASSERT(xDocShRef->IsSecurityOptOpenReadOnly());
|
||||
xDocShRef->DoClose();
|
||||
@ -939,7 +939,7 @@ void SdOOXMLExportTest3::testTdf118835()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf118835.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -968,7 +968,7 @@ void SdOOXMLExportTest3::testTdf118768()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf118768-brake.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -988,7 +988,7 @@ void SdOOXMLExportTest3::testTdf118836()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf118836.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1080,7 +1080,7 @@ void SdOOXMLExportTest3::testTdf116350TextEffects()
|
||||
CPPUNIT_ASSERT_EQUAL(true, bScaleX);
|
||||
|
||||
// Export
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1095,7 +1095,7 @@ void SdOOXMLExportTest3::testTdf128096()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128096.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1114,7 +1114,7 @@ void SdOOXMLExportTest3::testTdf120573()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf120573.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1136,7 +1136,7 @@ void SdOOXMLExportTest3::testTdf119118()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf119118.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
assertXPath(pXmlDocContent, "//p:iterate", "type", "lt");
|
||||
@ -1148,7 +1148,7 @@ void SdOOXMLExportTest3::testTdf99213()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf99213-target-missing.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
// Number of nodes with p:attrNameLst was 3, including one that missed tgtEl
|
||||
@ -1168,7 +1168,7 @@ void SdOOXMLExportTest3::testPotxExport()
|
||||
xLoadable->initNew();
|
||||
|
||||
// Export as a POTM template
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), POTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1183,7 +1183,7 @@ void SdOOXMLExportTest3::testPotxExport()
|
||||
|
||||
void SdOOXMLExportTest3::testTdf44223()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf44223.pptx"), PPTX);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
@ -1225,7 +1225,7 @@ void SdOOXMLExportTest3::testTdf135843()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf135843_export.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1250,7 +1250,7 @@ void SdOOXMLExportTest3::testSmartArtPreserve()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/smartart-preserve.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1306,7 +1306,7 @@ void SdOOXMLExportTest3::testTdf125346()
|
||||
// There are two themes in the test document, make sure we use the right theme
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf125346.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -1329,7 +1329,7 @@ void SdOOXMLExportTest3::testTdf125346_2()
|
||||
// Test more slides with different themes
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf125346_2.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
{
|
||||
@ -1385,7 +1385,7 @@ void SdOOXMLExportTest3::testTdf125360()
|
||||
|
||||
xShape->setPropertyValue("FillTransparence", uno::Any(static_cast<sal_Int32>(23)));
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xShape.set(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -1408,7 +1408,7 @@ void SdOOXMLExportTest3::testTdf125360_1()
|
||||
|
||||
xShape->setPropertyValue("FillTransparence", uno::Any(static_cast<sal_Int32>(23)));
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xShape.set(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -1435,7 +1435,7 @@ void SdOOXMLExportTest3::testTdf125360_2()
|
||||
|
||||
xShape->setPropertyValue("FillTransparence", uno::Any(static_cast<sal_Int32>(23)));
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xShape.set(getShapeFromPage(0, 0, xDocShRef));
|
||||
@ -1451,7 +1451,7 @@ void SdOOXMLExportTest3::testTdf125551()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf125551.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<drawing::XShapes> xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
|
||||
@ -1467,7 +1467,7 @@ void SdOOXMLExportTest3::testTdf136830()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf136830.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// Without the fix in place, the X position of the shapes would have been 0
|
||||
@ -1490,7 +1490,7 @@ void SdOOXMLExportTest3::testTdf126234()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf126234.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// check relative size of the bullet, 400% is a legitimate value for MS Office document
|
||||
@ -1510,7 +1510,7 @@ void SdOOXMLExportTest3::testTdf126741()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf126741.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
// dash dot dot line style import fix
|
||||
@ -1593,7 +1593,7 @@ void SdOOXMLExportTest3::testTdf128213()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf128213.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1604,7 +1604,7 @@ void SdOOXMLExportTest3::testTdf79082()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf79082.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
@ -1761,7 +1761,7 @@ void SdOOXMLExportTest3::testTdf132201EffectOrder()
|
||||
{
|
||||
auto xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/effectOrder.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
|
||||
assertXPathChildren(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst", 2);
|
||||
@ -1805,7 +1805,7 @@ void SdOOXMLExportTest3::testTdf119223()
|
||||
{
|
||||
auto xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf119223.odp"), ODP);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
@ -1830,7 +1830,7 @@ void SdOOXMLExportTest3::testTdf128213ShapeRot()
|
||||
{
|
||||
auto xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf128213-shaperot.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1846,7 +1846,7 @@ void SdOOXMLExportTest3::testTdf125560_textDeflate()
|
||||
{
|
||||
auto xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/ShapePlusImage.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
|
||||
// This problem did not affect the pptx export, only the ODP so assert that
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
@ -1863,7 +1863,7 @@ void SdOOXMLExportTest3::testTdf125560_textInflateTop()
|
||||
{
|
||||
auto xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/ShapeTextInflateTop.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
|
||||
// This problem did not affect the pptx export, only the ODP so assert that
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
@ -1881,7 +1881,7 @@ void SdOOXMLExportTest3::testTdf142235_TestPlaceholderTextAlignment()
|
||||
auto xDocShRef = loadURL(
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/placeholder-box-textalignment.odp"), ODP);
|
||||
|
||||
utl::TempFile tmpfile;
|
||||
utl::TempFileNamed tmpfile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tmpfile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1963,7 +1963,7 @@ void SdOOXMLExportTest3::testTdf143315()
|
||||
m_directories.getURLFromSrc(u"sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt"),
|
||||
PPT);
|
||||
|
||||
utl::TempFile tmpfile;
|
||||
utl::TempFileNamed tmpfile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tmpfile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -1999,7 +1999,7 @@ void SdOOXMLExportTest3::testTdf147121()
|
||||
const auto nFontSizeBefore = xRun->getPropertyValue("CharHeight").get<float>() * 100;
|
||||
|
||||
// Save and reload
|
||||
utl::TempFile tmpfile;
|
||||
utl::TempFileNamed tmpfile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tmpfile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -2053,7 +2053,7 @@ void SdOOXMLExportTest3::testTdf74670()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf74670.odp"), ODP);
|
||||
utl::TempFile tmpfile;
|
||||
utl::TempFileNamed tmpfile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tmpfile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
@ -2164,7 +2164,7 @@ void SdOOXMLExportTest3::testTdf149551_tbrl90()
|
||||
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode);
|
||||
|
||||
// Test, that it is exported to vert="vert"
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "ppt/slides/slide1.xml");
|
||||
assertXPath(pXmlDoc, "//a:bodyPr", "vert", "vert");
|
||||
@ -2200,7 +2200,7 @@ void SdOOXMLExportTest3::testTdf149551_btlr()
|
||||
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, eWritingMode);
|
||||
|
||||
// Test, that it is exported to vert="vert270"
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "ppt/slides/slide1.xml");
|
||||
assertXPath(pXmlDoc, "//a:bodyPr", "vert", "vert270");
|
||||
@ -2233,7 +2233,7 @@ void SdOOXMLExportTest3::testTdf94122_autoColor()
|
||||
::sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf94122_autocolor.odp"), ODP);
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
xDocShRef->DoClose();
|
||||
|
||||
|
@ -327,7 +327,7 @@ void SdExportTest::testMediaEmbedding()
|
||||
void SdExportTest::testFillBitmapUnused()
|
||||
{
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/fillbitmap2.odp"), ODP);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &aTempFile);
|
||||
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "content.xml");
|
||||
@ -417,7 +417,7 @@ void SdExportTest::testTdf97630()
|
||||
|
||||
}
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &aTempFile);
|
||||
|
||||
{
|
||||
@ -486,7 +486,7 @@ void SdExportTest::testSwappedOutImageExport()
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(aFileFormats[vFormats[nExportFormat]].pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent.set(xStorable, uno::UNO_QUERY);
|
||||
@ -541,7 +541,7 @@ void SdExportTest::testOOoXMLAnimations()
|
||||
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(getFormat(ODP)->pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
|
||||
@ -618,7 +618,7 @@ void SdExportTest::testUnknownAttributes()
|
||||
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(getFormat(ODP)->pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
|
||||
@ -726,7 +726,7 @@ void SdExportTest::testLinkedGraphicRT()
|
||||
}
|
||||
|
||||
// Save and reload
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent.set(xStorable, uno::UNO_QUERY);
|
||||
@ -758,7 +758,7 @@ void SdExportTest::testTdf79082()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/ppt/tdf79082.ppt"), PPT);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
tempFile.EnableKillingFile();
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "content.xml");
|
||||
@ -821,7 +821,7 @@ void SdExportTest::testImageWithSpecialID()
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(aFileFormats[vFormats[nExportFormat]].pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent.set(xStorable, uno::UNO_QUERY);
|
||||
@ -998,7 +998,7 @@ void SdExportTest::testDefaultSubscripts()
|
||||
|
||||
void SdExportTest::testTdf98477()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf98477grow.pptx"), PPTX);
|
||||
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
@ -1027,7 +1027,7 @@ void SdExportTest::testAuthorField()
|
||||
|
||||
void SdExportTest::testTdf50499()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf50499.pptx"), PPTX);
|
||||
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
@ -1116,7 +1116,7 @@ void SdExportTest::testTextRotation()
|
||||
pBatch->commit();
|
||||
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/shape-text-rotate.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
|
||||
uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef));
|
||||
@ -1136,7 +1136,7 @@ void SdExportTest::testTextRotation()
|
||||
pBatch->commit();
|
||||
|
||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/shape-text-rotate.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
|
||||
uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef));
|
||||
@ -1165,7 +1165,7 @@ void SdExportTest::testTdf115394PPT()
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(aFileFormats[PPT].pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent.set(xStorable, uno::UNO_QUERY);
|
||||
@ -1204,7 +1204,7 @@ void SdExportTest::testBulletsAsImage()
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(aFileFormats[nExportFormat].pFilterName), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
|
||||
xComponent.set(xStorable, uno::UNO_QUERY);
|
||||
@ -1284,7 +1284,7 @@ void SdExportTest::testBulletsAsImage()
|
||||
|
||||
void SdExportTest::testTdf113822()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf113822underline.pptx"), PPTX);
|
||||
|
||||
// Was unable to export iterate container (tdf#99213).
|
||||
@ -1307,7 +1307,7 @@ void SdExportTest::testTdf113822()
|
||||
|
||||
void SdExportTest::testTdf113818()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf113818-swivel.pptx"), PPTX);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPT);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
@ -1321,7 +1321,7 @@ void SdExportTest::testTdf113818()
|
||||
|
||||
void SdExportTest::testTdf119629()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/ppt/tdf119629.ppt"), PPT);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPT);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
@ -1342,7 +1342,7 @@ void SdExportTest::testTdf119629()
|
||||
|
||||
void SdExportTest::testTdf141269()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf141269.odp"), ODP);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPT);
|
||||
|
||||
@ -1371,7 +1371,7 @@ void SdExportTest::testTdf141269()
|
||||
|
||||
void SdExportTest::testTdf123557()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/trigger.pptx"), PPTX);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
@ -1414,7 +1414,7 @@ void SdExportTest::testTdf126761()
|
||||
void SdExportTest::testGlow()
|
||||
{
|
||||
auto xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odg/glow.odg"), ODG);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile);
|
||||
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
|
||||
@ -1456,7 +1456,7 @@ void SdExportTest::testSoftEdges()
|
||||
{
|
||||
auto xDocShRef
|
||||
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odg/softedges.odg"), ODG);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile);
|
||||
auto xShapeProps(getShapeFromPage(0, 0, xDocShRef));
|
||||
|
||||
@ -1483,7 +1483,7 @@ void SdExportTest::testSoftEdges()
|
||||
void SdExportTest::testShadowBlur()
|
||||
{
|
||||
auto xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odg/shadow-blur.odg"), ODG);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile);
|
||||
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
|
||||
@ -1519,7 +1519,7 @@ void SdExportTest::testTdf91060()
|
||||
|
||||
void SdExportTest::testTdf128550()
|
||||
{
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf128550.pptx"), PPTX);
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "content.xml");
|
||||
@ -1534,7 +1534,7 @@ void SdExportTest::testTdf140714()
|
||||
//Without the fix in place, shape will be imported as GraphicObjectShape instead of CustomShape.
|
||||
|
||||
auto xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf140714.pptx"), PPTX);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
|
||||
|
||||
uno::Reference<drawing::XShape> xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
|
||||
@ -1608,7 +1608,7 @@ void SdExportTest::testMasterPageBackgroundFullSize()
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xBackgroundProps->getPropertyValue("FillTransparence").get<sal_Int16>());
|
||||
}
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
|
||||
|
||||
xMPS.set(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
|
||||
@ -1717,7 +1717,7 @@ void SdExportTest::testColumnsODG()
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(700), pTextObj->GetTextColumnsSpacing());
|
||||
}
|
||||
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile);
|
||||
|
||||
{
|
||||
@ -1759,7 +1759,7 @@ void SdExportTest::testColumnsODG()
|
||||
void SdExportTest::testTdf112126()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/tdf112126.odg"), ODG);
|
||||
utl::TempFile tempFile;
|
||||
utl::TempFileNamed tempFile;
|
||||
xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile);
|
||||
uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef));
|
||||
uno::Reference<beans::XPropertySet> xPropertySet(xPage, uno::UNO_QUERY);
|
||||
|
@ -567,7 +567,7 @@ void SdMiscTest::testTdf101242_ODF_add_settings()
|
||||
std::shared_ptr<comphelper::ConfigurationChanges> pBatch( comphelper::ConfigurationChanges::create() );
|
||||
officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(true, pBatch);
|
||||
pBatch->commit();
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
save(xDocShRef.get(), getFormat(ODG), aTempFile );
|
||||
|
||||
@ -617,7 +617,7 @@ void SdMiscTest::testTdf101242_ODF_no_settings()
|
||||
std::shared_ptr<comphelper::ConfigurationChanges> pBatch( comphelper::ConfigurationChanges::create() );
|
||||
officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(false, pBatch);
|
||||
pBatch->commit();
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
save(xDocShRef.get(), getFormat(ODG), aTempFile );
|
||||
|
||||
@ -659,7 +659,7 @@ void SdMiscTest::testTdf101242_settings_keep()
|
||||
std::shared_ptr<comphelper::ConfigurationChanges> pBatch( comphelper::ConfigurationChanges::create() );
|
||||
officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(true, pBatch);
|
||||
pBatch->commit();
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
save(xDocShRef.get(), getFormat(ODG), aTempFile );
|
||||
|
||||
@ -710,7 +710,7 @@ void SdMiscTest::testTdf101242_settings_remove()
|
||||
std::shared_ptr<comphelper::ConfigurationChanges> pBatch( comphelper::ConfigurationChanges::create() );
|
||||
officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(false, pBatch);
|
||||
pBatch->commit();
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
save(xDocShRef.get(), getFormat(ODG), aTempFile );
|
||||
|
||||
@ -757,7 +757,7 @@ void SdMiscTest::testTdf119392()
|
||||
pPageView -> SetLayerVisible("-P-", false);
|
||||
pPageView -> SetLayerPrintable("-P-", true);
|
||||
pPageView -> SetLayerLocked("-P-", false);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
save(xDocShRef.get(), getFormat(ODG), aTempFile );
|
||||
|
||||
@ -849,7 +849,7 @@ void SdMiscTest::testTdf98839_ShearVFlipH()
|
||||
pShape->Mirror(Point(4000, 2000), Point(4000, 10000));
|
||||
|
||||
// Save and examine attribute draw:transform
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
save(xDocShRef.get(), getFormat(ODG), aTempFile);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "content.xml");
|
||||
|
@ -198,7 +198,7 @@ protected:
|
||||
return pFormat;
|
||||
}
|
||||
|
||||
void exportTo(sd::DrawDocShell* pShell, FileFormat const * pFormat, utl::TempFile const & rTempFile)
|
||||
void exportTo(sd::DrawDocShell* pShell, FileFormat const * pFormat, utl::TempFileNamed const & rTempFile)
|
||||
{
|
||||
SfxMedium aStoreMedium(rTempFile.GetURL(), StreamMode::STD_WRITE);
|
||||
if ( std::strcmp(pFormat->pName, "odg") == 0)
|
||||
@ -238,7 +238,7 @@ protected:
|
||||
|
||||
}
|
||||
|
||||
void save(sd::DrawDocShell* pShell, FileFormat const * pFormat, utl::TempFile const & rTempFile)
|
||||
void save(sd::DrawDocShell* pShell, FileFormat const * pFormat, utl::TempFileNamed const & rTempFile)
|
||||
{
|
||||
SfxMedium aStoreMedium(rTempFile.GetURL(), StreamMode::STD_WRITE);
|
||||
if ( std::strcmp(pFormat->pName, "odg") == 0 )
|
||||
@ -276,13 +276,13 @@ protected:
|
||||
}
|
||||
|
||||
sd::DrawDocShellRef saveAndReload(sd::DrawDocShell *pShell, sal_Int32 nExportType,
|
||||
utl::TempFile * pTempFile = nullptr)
|
||||
utl::TempFileNamed * pTempFile = nullptr)
|
||||
{
|
||||
FileFormat* pFormat = getFormat(nExportType);
|
||||
std::unique_ptr<utl::TempFile> pNewTempFile;
|
||||
std::unique_ptr<utl::TempFileNamed> pNewTempFile;
|
||||
if (!pTempFile)
|
||||
{
|
||||
pNewTempFile.reset(new utl::TempFile);
|
||||
pNewTempFile.reset(new utl::TempFileNamed);
|
||||
pTempFile = pNewTempFile.get();
|
||||
}
|
||||
save(pShell, pFormat, *pTempFile);
|
||||
@ -444,7 +444,7 @@ class SdModelTestBaseXML
|
||||
{
|
||||
|
||||
public:
|
||||
xmlDocUniquePtr parseExport(utl::TempFile const & rTempFile, OUString const& rStreamName)
|
||||
xmlDocUniquePtr parseExport(utl::TempFileNamed const & rTempFile, OUString const& rStreamName)
|
||||
{
|
||||
std::unique_ptr<SvStream> const pStream(parseExportStream(rTempFile, rStreamName));
|
||||
xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
|
||||
|
@ -72,7 +72,8 @@ public:
|
||||
void insertStringToObject(sal_uInt16 nObj, const std::u16string_view& rStr, bool bUseEscape);
|
||||
sd::slidesorter::SlideSorterViewShell* getSlideSorterViewShell();
|
||||
FileFormat* getFormat(sal_Int32 nExportType);
|
||||
void save(sd::DrawDocShell* pShell, FileFormat const* pFormat, utl::TempFile const& rTempFile);
|
||||
void save(sd::DrawDocShell* pShell, FileFormat const* pFormat,
|
||||
utl::TempFileNamed const& rTempFile);
|
||||
};
|
||||
|
||||
void SdUiImpressTest::setUp()
|
||||
@ -174,7 +175,7 @@ FileFormat* SdUiImpressTest::getFormat(sal_Int32 nExportType)
|
||||
}
|
||||
|
||||
void SdUiImpressTest::save(sd::DrawDocShell* pShell, FileFormat const* pFormat,
|
||||
utl::TempFile const& rTempFile)
|
||||
utl::TempFileNamed const& rTempFile)
|
||||
{
|
||||
SfxMedium aStoreMedium(rTempFile.GetURL(), StreamMode::STD_WRITE);
|
||||
if (std::strcmp(pFormat->pName, "odg") == 0)
|
||||
@ -1118,7 +1119,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
|
||||
dispatchCommand(mxComponent, ".uno:OutlineFont", {});
|
||||
|
||||
// Save it as PPTX and load it again.
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
save(dynamic_cast<SdXImpressDocument*>(mxComponent.get())->GetDocShell(), getFormat(PPTX),
|
||||
aTempFile);
|
||||
mxComponent = loadFromDesktop(aTempFile.GetURL());
|
||||
|
@ -597,8 +597,7 @@ bool SdTransferable::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pOb
|
||||
case SDTRANSFER_OBJECTTYPE_DRAWOLE:
|
||||
{
|
||||
SfxObjectShell* pEmbObj = static_cast<SfxObjectShell*>(pObject);
|
||||
::utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
::utl::TempFileFast aTempFile;
|
||||
SvStream* pTempStream = aTempFile.GetStream(StreamMode::READWRITE);
|
||||
|
||||
try
|
||||
|
@ -80,7 +80,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testODFCustomMetadata)
|
||||
uno::Sequence<beans::PropertyValue> mimeArgs({
|
||||
beans::PropertyValue("MediaType", -1, uno::Any(OUString("application/vnd.oasis.opendocument.text")), beans::PropertyState_DIRECT_VALUE)
|
||||
});
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
xProps->storeToMedium(aTempFile.GetURL(), mimeArgs);
|
||||
|
||||
// check that custom metadata is preserved
|
||||
@ -111,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testNoThumbnail)
|
||||
#endif
|
||||
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xStorable.is());
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
uno::Sequence<beans::PropertyValue> aProperties(
|
||||
comphelper::InitPropertySequence({ { "NoThumbnail", uno::Any(true) } }));
|
||||
@ -193,7 +193,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
|
||||
CPPUNIT_TEST_FIXTURE(MiscTest, testOverwrite)
|
||||
{
|
||||
// tdf#60237 - try to overwrite an existing file using the different settings of the Overwrite option
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
uno::Reference<lang::XComponent> xComponent
|
||||
= loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument");
|
||||
|
@ -72,13 +72,12 @@ bool flatpak::createTemporaryHtmlDirectory(OUString ** url) {
|
||||
if (!parent.endsWith("/")) {
|
||||
parent += "/";
|
||||
}
|
||||
auto const tmp = utl::TempFile(&parent, true);
|
||||
if (!tmp.IsValid()) {
|
||||
temporaryHtmlDirectoryStatus.url = utl::CreateTempURL(&parent, true);
|
||||
if (temporaryHtmlDirectoryStatus.url.isEmpty()) {
|
||||
SAL_WARN(
|
||||
"sfx.appl", "LIBO_FLATPAK mode failure creating temp dir at <" << parent << ">");
|
||||
return false;
|
||||
}
|
||||
temporaryHtmlDirectoryStatus.url = tmp.GetURL();
|
||||
temporaryHtmlDirectoryStatus.created = true;
|
||||
}
|
||||
*url = &temporaryHtmlDirectoryStatus.url;
|
||||
|
@ -961,7 +961,7 @@ static bool impl_showOfflineHelp(const OUString& rURL, weld::Widget* pDialogPare
|
||||
if (flatpak::isFlatpak() && !flatpak::createTemporaryHtmlDirectory(&parent)) {
|
||||
return false;
|
||||
}
|
||||
::utl::TempFile aTempFile(u"NewHelp", true, aExtension, parent, false );
|
||||
::utl::TempFileNamed aTempFile(u"NewHelp", true, aExtension, parent, false );
|
||||
|
||||
SvStream* pStream = aTempFile.GetStream(StreamMode::WRITE);
|
||||
pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
|
||||
|
@ -65,7 +65,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde
|
||||
::ucbhelper::Content aContent;
|
||||
if( ::ucbhelper::Content::create( aFolderUrl, xComEnv, comphelper::getProcessComponentContext(), aContent ) )
|
||||
{
|
||||
OUString aTempURL = ::utl::TempFile().GetURL();
|
||||
OUString aTempURL = ::utl::CreateTempURL();
|
||||
try {
|
||||
if ( aContent.isFolder() )
|
||||
{
|
||||
|
@ -457,9 +457,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
|
||||
// This makes it possible to store the file for "send document as e-mail"
|
||||
// with the original file name. We cannot use the original file as
|
||||
// some mail programs need exclusive access.
|
||||
::utl::TempFile aTempDir( nullptr, true );
|
||||
|
||||
INetURLObject aFilePathObj( aTempDir.GetURL() );
|
||||
INetURLObject aFilePathObj( ::utl::CreateTempURL(nullptr, true) );
|
||||
aFilePathObj.insertName( aFileName );
|
||||
aFilePathObj.setExtension( aExtension );
|
||||
|
||||
|
@ -399,7 +399,7 @@ public:
|
||||
|
||||
uno::Sequence < util::RevisionTag > aVersions;
|
||||
|
||||
std::unique_ptr<::utl::TempFile> pTempFile;
|
||||
std::unique_ptr<::utl::TempFileNamed> pTempFile;
|
||||
|
||||
uno::Reference<embed::XStorage> xStorage;
|
||||
uno::Reference<embed::XStorage> m_xZipStorage;
|
||||
@ -1785,8 +1785,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempFile )
|
||||
if ( pStream && pStream->GetError() == ERRCODE_NONE )
|
||||
{
|
||||
// Unpack Stream in TempDir
|
||||
::utl::TempFile aTempFile;
|
||||
const OUString& aTmpName = aTempFile.GetURL();
|
||||
const OUString aTmpName = ::utl::CreateTempURL();
|
||||
SvFileStream aTmpStream( aTmpName, SFX_STREAM_READWRITE );
|
||||
|
||||
pStream->ReadStream( aTmpStream );
|
||||
@ -2519,7 +2518,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
|
||||
if ( !pImpl->m_aBackupURL.isEmpty() )
|
||||
return; // the backup was done already
|
||||
|
||||
::utl::TempFile aTransactTemp( aPrefix, true, aExtension, &aDestDir );
|
||||
::utl::TempFileNamed aTransactTemp( aPrefix, true, aExtension, &aDestDir );
|
||||
|
||||
INetURLObject aBackObj( aTransactTemp.GetURL() );
|
||||
OUString aBackupName = aBackObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset );
|
||||
@ -3324,7 +3323,7 @@ void SfxMedium::CompleteReOpen()
|
||||
bool bUseInteractionHandler = pImpl->bUseInteractionHandler;
|
||||
pImpl->bUseInteractionHandler = false;
|
||||
|
||||
std::unique_ptr<::utl::TempFile> pTmpFile;
|
||||
std::unique_ptr<::utl::TempFileNamed> pTmpFile;
|
||||
if ( pImpl->pTempFile )
|
||||
{
|
||||
pTmpFile = std::move(pImpl->pTempFile);
|
||||
@ -3831,7 +3830,7 @@ void SfxMedium::CreateTempFile( bool bReplace )
|
||||
}
|
||||
|
||||
OUString aLogicBase = GetLogicBase(GetURLObject(), pImpl);
|
||||
pImpl->pTempFile.reset(new ::utl::TempFile(&aLogicBase));
|
||||
pImpl->pTempFile.reset(new ::utl::TempFileNamed(&aLogicBase));
|
||||
pImpl->pTempFile->EnableKillingFile();
|
||||
pImpl->m_aName = pImpl->pTempFile->GetFileName();
|
||||
OUString aTmpURL = pImpl->pTempFile->GetURL();
|
||||
@ -3927,7 +3926,7 @@ void SfxMedium::CreateTempFileNoCopy()
|
||||
pImpl->pTempFile.reset();
|
||||
|
||||
OUString aLogicBase = GetLogicBase(GetURLObject(), pImpl);
|
||||
pImpl->pTempFile.reset(new ::utl::TempFile(&aLogicBase));
|
||||
pImpl->pTempFile.reset(new ::utl::TempFileNamed(&aLogicBase));
|
||||
pImpl->pTempFile->EnableKillingFile();
|
||||
pImpl->m_aName = pImpl->pTempFile->GetFileName();
|
||||
if ( pImpl->m_aName.isEmpty() )
|
||||
@ -4272,7 +4271,7 @@ OUString SfxMedium::CreateTempCopyWithExt( std::u16string_view aURL )
|
||||
size_t nPrefixLen = aURL.rfind( '.' );
|
||||
std::u16string_view aExt = ( nPrefixLen == std::u16string_view::npos ) ? std::u16string_view() : aURL.substr( nPrefixLen );
|
||||
|
||||
OUString aNewTempFileURL = ::utl::TempFile( u"", true, aExt ).GetURL();
|
||||
OUString aNewTempFileURL = ::utl::CreateTempURL( u"", true, aExt );
|
||||
if ( !aNewTempFileURL.isEmpty() )
|
||||
{
|
||||
INetURLObject aSource( aURL );
|
||||
@ -4345,7 +4344,7 @@ OUString SfxMedium::SwitchDocumentToTempFile()
|
||||
std::u16string_view aExt = (nPrefixLen == -1)
|
||||
? std::u16string_view()
|
||||
: aOrigURL.subView(nPrefixLen);
|
||||
OUString aNewURL = ::utl::TempFile( u"", true, aExt ).GetURL();
|
||||
OUString aNewURL = ::utl::CreateTempURL( u"", true, aExt );
|
||||
|
||||
// TODO/LATER: In future the aLogicName should be set to shared folder URL
|
||||
// and a temporary file should be created. Transport_Impl should be impossible then.
|
||||
|
@ -77,7 +77,7 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
|
||||
#ifdef _WIN32
|
||||
if ( pGDIMeta )
|
||||
{
|
||||
::utl::TempFile aTempFile( u"", true, u".emf" );
|
||||
::utl::TempFileNamed aTempFile( u"", true, u".emf" );
|
||||
|
||||
OUString aMetaFile = aTempFile.GetFileName();
|
||||
OUString aMetaURL = aTempFile.GetURL();
|
||||
|
@ -248,7 +248,7 @@ bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
|
||||
|
||||
OUString SfxObjectShell::CreateTempCopyOfStorage_Impl( const uno::Reference< embed::XStorage >& xStorage )
|
||||
{
|
||||
OUString aTempURL = ::utl::TempFile().GetURL();
|
||||
OUString aTempURL = ::utl::CreateTempURL();
|
||||
|
||||
DBG_ASSERT( !aTempURL.isEmpty(), "Can't create a temporary file!\n" );
|
||||
if ( !aTempURL.isEmpty() )
|
||||
|
@ -461,11 +461,11 @@ class ImplUCBPrintWatcher : public ::osl::Thread
|
||||
/// this describes the target location for the printed temp file
|
||||
OUString m_sTargetURL;
|
||||
/// it holds the temp file alive, till the print job will finish and remove it from disk automatically if the object die
|
||||
::utl::TempFile* m_pTempFile;
|
||||
::utl::TempFileNamed* m_pTempFile;
|
||||
|
||||
public:
|
||||
/* initialize this watcher but don't start it */
|
||||
ImplUCBPrintWatcher( SfxPrinter* pPrinter, ::utl::TempFile* pTempFile, OUString sTargetURL )
|
||||
ImplUCBPrintWatcher( SfxPrinter* pPrinter, ::utl::TempFileNamed* pTempFile, OUString sTargetURL )
|
||||
: m_pPrinter ( pPrinter )
|
||||
, m_sTargetURL(std::move( sTargetURL ))
|
||||
, m_pTempFile ( pTempFile )
|
||||
@ -508,7 +508,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
|
||||
the thread, if finishing of the job was detected outside this thread.
|
||||
But it must be called without using a corresponding thread for the given parameter!
|
||||
*/
|
||||
static void moveAndDeleteTemp( ::utl::TempFile** ppTempFile, std::u16string_view sTargetURL )
|
||||
static void moveAndDeleteTemp( ::utl::TempFileNamed** ppTempFile, std::u16string_view sTargetURL )
|
||||
{
|
||||
// move the file
|
||||
try
|
||||
@ -577,7 +577,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
|
||||
// a local one we can suppress this special handling. Because then vcl makes all
|
||||
// right for us.
|
||||
OUString sUcbUrl;
|
||||
::utl::TempFile* pUCBPrintTempFile = nullptr;
|
||||
::utl::TempFileNamed* pUCBPrintTempFile = nullptr;
|
||||
|
||||
uno::Sequence < beans::PropertyValue > aCheckedArgs( rOptions.getLength() );
|
||||
auto pCheckedArgs = aCheckedArgs.getArray();
|
||||
@ -654,7 +654,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
|
||||
// Execution of the print job will be done later by executing
|
||||
// a slot ...
|
||||
if(!pUCBPrintTempFile)
|
||||
pUCBPrintTempFile = new ::utl::TempFile();
|
||||
pUCBPrintTempFile = new ::utl::TempFileNamed();
|
||||
pUCBPrintTempFile->EnableKillingFile();
|
||||
|
||||
//FIXME: does it work?
|
||||
|
@ -2057,7 +2057,7 @@ Any SAL_CALL SfxBaseModel::getTransferData( const datatransfer::DataFlavor& aFla
|
||||
|
||||
try
|
||||
{
|
||||
utl::TempFile aTmp;
|
||||
utl::TempFileNamed aTmp;
|
||||
aTmp.EnableKillingFile();
|
||||
storeToURL( aTmp.GetURL(), Sequence < beans::PropertyValue >() );
|
||||
std::unique_ptr<SvStream> pStream(aTmp.GetStream( StreamMode::READ ));
|
||||
|
@ -616,9 +616,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
|
||||
{
|
||||
SAL_WARN("sfx.view", "cannot create Flatpak html temp dir");
|
||||
}
|
||||
::utl::TempFile aTempDir( parent, true );
|
||||
|
||||
INetURLObject aFilePathObj( aTempDir.GetURL() );
|
||||
INetURLObject aFilePathObj( ::utl::CreateTempURL(parent, true) );
|
||||
aFilePathObj.insertName( aFileName );
|
||||
aFilePathObj.setExtension( u"htm" );
|
||||
|
||||
|
@ -191,7 +191,7 @@ OUString CSmplMailClient::CopyAttachment(const OUString& sOrigAttachURL, OUStrin
|
||||
// removed in Desktop::RemoveTemporaryDirectory() if soffice process gets closed before the
|
||||
// mailer finishes using them.
|
||||
|
||||
maAttachmentFiles.emplace_back(std::make_unique<utl::TempFile>(&GetBaseTempDirURL()));
|
||||
maAttachmentFiles.emplace_back(std::make_unique<utl::TempFileNamed>(&GetBaseTempDirURL()));
|
||||
maAttachmentFiles.back()->EnableKillingFile();
|
||||
INetURLObject aFilePathObj(maAttachmentFiles.back()->GetURL());
|
||||
OUString sNewAttachmentURL = aFilePathObj.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
|
@ -42,7 +42,7 @@ private:
|
||||
// Don't try to delete the copied attachment files; let the spawned process cleanup them
|
||||
void ReleaseAttachments();
|
||||
|
||||
std::vector< std::unique_ptr<utl::TempFile> > maAttachmentFiles;
|
||||
std::vector< std::unique_ptr<utl::TempFileNamed> > maAttachmentFiles;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -339,7 +339,7 @@ Storage::Storage( OUString aFile, StreamMode m, bool bDirect )
|
||||
if( aName.isEmpty() )
|
||||
{
|
||||
// no name = temporary name!
|
||||
aName = utl::TempFile::CreateTempName();
|
||||
aName = utl::CreateTempName();
|
||||
bTemp = true;
|
||||
}
|
||||
// the root storage creates the I/O system
|
||||
|
@ -1225,7 +1225,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
|
||||
{
|
||||
if( n > THRESHOLD )
|
||||
{
|
||||
m_aName = utl::TempFile(nullptr, false).GetURL();
|
||||
m_aName = utl::CreateTempURL();
|
||||
std::unique_ptr<SvFileStream> s(new SvFileStream( m_aName, StreamMode::READWRITE ));
|
||||
const sal_uInt64 nCur = Tell();
|
||||
sal_uInt64 i = nEndOfData;
|
||||
|
@ -460,7 +460,7 @@ public:
|
||||
OUString m_aContentType;
|
||||
OUString m_aOriginalContentType;
|
||||
std::unique_ptr<::ucbhelper::Content> m_pContent; // the content that provides the storage elements
|
||||
std::unique_ptr<::utl::TempFile> m_pTempFile; // temporary file, only for storages on stream
|
||||
std::unique_ptr<::utl::TempFileNamed> m_pTempFile; // temporary file, only for storages on stream
|
||||
SvStream* m_pSource; // original stream, only for storages on a stream
|
||||
ErrCode m_nError;
|
||||
StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing )
|
||||
@ -681,7 +681,7 @@ bool UCBStorageStream_Impl::Init()
|
||||
// create one
|
||||
|
||||
if ( m_aTempURL.isEmpty() )
|
||||
m_aTempURL = ::utl::TempFile().GetURL();
|
||||
m_aTempURL = ::utl::CreateTempURL();
|
||||
|
||||
m_pStream = ::utl::UcbStreamHelper::CreateStream( m_aTempURL, StreamMode::STD_READWRITE, true /* bFileExists */ );
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
@ -1451,7 +1451,7 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const OU
|
||||
{
|
||||
// no name given = use temporary name!
|
||||
DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" );
|
||||
m_pTempFile.reset(new ::utl::TempFile);
|
||||
m_pTempFile.reset(new ::utl::TempFileNamed);
|
||||
m_pTempFile->EnableKillingFile();
|
||||
m_aName = aName = m_pTempFile->GetURL();
|
||||
}
|
||||
@ -1479,7 +1479,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt
|
||||
{
|
||||
// no name given = use temporary name!
|
||||
DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" );
|
||||
m_pTempFile.reset(new ::utl::TempFile);
|
||||
m_pTempFile.reset(new ::utl::TempFileNamed);
|
||||
m_pTempFile->EnableKillingFile();
|
||||
m_aName = aName = m_pTempFile->GetURL();
|
||||
}
|
||||
@ -1507,7 +1507,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt
|
||||
|
||||
UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool bDirect )
|
||||
: m_pAntiImpl( pStorage )
|
||||
, m_pTempFile( new ::utl::TempFile )
|
||||
, m_pTempFile( new ::utl::TempFileNamed )
|
||||
, m_pSource( &rStream )
|
||||
, m_nError( ERRCODE_NONE )
|
||||
, m_bCommited( false )
|
||||
@ -2108,7 +2108,7 @@ sal_Int16 UCBStorage_Impl::Commit()
|
||||
{
|
||||
// create a stream to write the manifest file - use a temp file
|
||||
OUString aURL( aNewSubFolder.getURL() );
|
||||
std::optional< ::utl::TempFile> pTempFile(&aURL );
|
||||
std::optional< ::utl::TempFileNamed > pTempFile(&aURL );
|
||||
|
||||
// get the stream from the temp file and create an output stream wrapper
|
||||
SvStream* pStream = pTempFile->GetStream( StreamMode::STD_READWRITE );
|
||||
|
@ -77,7 +77,7 @@ void MathMLExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
|
||||
|
||||
xmlDocUniquePtr MathMLExportTest::exportAndParse()
|
||||
{
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
SfxMedium aStoreMedium(aTempFile.GetURL(), StreamMode::STD_WRITE);
|
||||
std::shared_ptr<const SfxFilter> pExportFilter = SfxFilter::GetFilterByName(MATHML_XML);
|
||||
|
@ -37,8 +37,7 @@ using namespace ::com::sun::star;
|
||||
|
||||
uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstance()
|
||||
{
|
||||
OUString aTempURL = ::utl::TempFile( nullptr, true ).GetURL();
|
||||
|
||||
OUString aTempURL = ::utl::CreateTempURL( nullptr, true );
|
||||
if ( aTempURL.isEmpty() )
|
||||
throw uno::RuntimeException("Cannot create tempfile.");
|
||||
|
||||
|
@ -101,8 +101,7 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo
|
||||
{
|
||||
// TODO/LATER: Probably the graphic should be copied here as well
|
||||
// currently it is handled by the applications
|
||||
utl::TempFile aTmp;
|
||||
aTmp.EnableKillingFile();
|
||||
utl::TempFileFast aTmp;
|
||||
uno::Reference < embed::XEmbedPersist > xPers( m_xObj, uno::UNO_QUERY );
|
||||
if ( xPers.is() )
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(XTableImportExportTest, testImportExport)
|
||||
{
|
||||
utl::TempFile aTempFile(nullptr, true);
|
||||
utl::TempFileNamed aTempFile(nullptr, true);
|
||||
aTempFile.EnableKillingFile();
|
||||
OUString aTempURL = aTempFile.GetURL();
|
||||
BitmapChecksum aChecksum(0);
|
||||
|
@ -64,7 +64,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChartExportToPdf)
|
||||
uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
|
||||
|
||||
// When exporting that chart to PDF:
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
GraphicHelper::SaveShapeAsGraphicToPath(getComponent(), xShape, "application/pdf",
|
||||
aTempFile.GetURL());
|
||||
|
||||
|
@ -179,7 +179,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_NonUI)
|
||||
|
||||
// Generate bitmap from shape
|
||||
uno::Reference<drawing::XShape> xShape = getShape(0);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
|
||||
|
||||
@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_FrontLightDim)
|
||||
|
||||
// Generate bitmap from shape
|
||||
uno::Reference<drawing::XShape> xShape = getShape(0);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
|
||||
|
||||
@ -251,7 +251,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_FirstLightHarsh)
|
||||
|
||||
// Generate bitmap from shape
|
||||
uno::Reference<drawing::XShape> xShape = getShape(0);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
|
||||
|
||||
@ -1234,7 +1234,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf136176)
|
||||
|
||||
// Save and reload
|
||||
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
utl::MediaDescriptor aMediaDescriptor;
|
||||
aMediaDescriptor["FilterName"] <<= OUString("draw8");
|
||||
@ -1276,7 +1276,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf148501_OctagonBevel)
|
||||
|
||||
// Generate bitmap from shape
|
||||
uno::Reference<drawing::XShape> xShape = getShape(0);
|
||||
utl::TempFile aTempFile;
|
||||
utl::TempFileNamed aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
|
||||
|
||||
|
@ -57,8 +57,8 @@ public:
|
||||
void GalleryObjTest::TestCreateTheme()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -86,8 +86,8 @@ void GalleryObjTest::TestCreateTheme()
|
||||
void GalleryObjTest::TestDeleteTheme()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -122,8 +122,8 @@ void GalleryObjTest::TestDeleteTheme()
|
||||
void GalleryObjTest::TestSetThemeName()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -153,8 +153,8 @@ void GalleryObjTest::TestSetThemeName()
|
||||
void GalleryObjTest::TestThemeURLCase()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -191,8 +191,8 @@ void GalleryObjTest::TestThemeURLCase()
|
||||
|
||||
void GalleryObjTest::TestThemeCount()
|
||||
{
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -232,8 +232,8 @@ void GalleryObjTest::TestThemeCount()
|
||||
void GalleryObjTest::TestGalleryThemeEntry()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -286,8 +286,8 @@ void GalleryObjTest::TestGalleryThemeEntry()
|
||||
void GalleryObjTest::TestInsertGalleryObject()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -331,8 +331,8 @@ void GalleryObjTest::TestInsertGalleryObject()
|
||||
void GalleryObjTest::TestRemoveGalleryObject()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -386,8 +386,8 @@ void GalleryObjTest::TestRemoveGalleryObject()
|
||||
void GalleryObjTest::TestChangePositionGalleryObject()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
@ -448,8 +448,8 @@ void GalleryObjTest::TestChangePositionGalleryObject()
|
||||
void GalleryObjTest::TestGetThemeNameFromGalleryTheme()
|
||||
{
|
||||
// Create theme
|
||||
std::unique_ptr<utl::TempFile> pTempDir;
|
||||
pTempDir.reset(new utl::TempFile(nullptr, true));
|
||||
std::unique_ptr<utl::TempFileNamed> pTempDir;
|
||||
pTempDir.reset(new utl::TempFileNamed(nullptr, true));
|
||||
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
|
||||
pTempDir->EnableKillingFile();
|
||||
const OUString aGalleryURL = pTempDir->GetURL();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user