[Libreoffice-commits] core.git: sw/qa

Stephan Bergmann sbergman at redhat.com
Thu Mar 29 09:13:17 UTC 2018


 sw/qa/extras/uiwriter/uiwriter.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit b0f00885a9de28be03a9b61bd7065116bbd1114a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 29 09:32:04 2018 +0200

    Operate on copies of test documents
    
    ...as the SwTextBlocks ctor internally calls SwDOCXReader::MakeEntries ->
    BeginPutDoc which wants to open the document read-write.  That would fail if
    SRCDIR is a read-only tree.
    
    Change-Id: I433b80bcec53c8ca4282d1f45c941153a4064eb9
    Reviewed-on: https://gerrit.libreoffice.org/52053
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 42bdf476b551..33ecdadaa6a2 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -522,7 +522,12 @@ SwDoc* SwUiWriterTest::createDoc(const char* pName)
 
 std::unique_ptr<SwTextBlocks> SwUiWriterTest::readDOCXAutotext(const OUString& sFileName, bool bEmpty)
 {
-    OUString rURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + sFileName;
+    utl::TempFile tmp;
+    tmp.EnableKillingFile();
+    OUString rURL = tmp.GetURL();
+    CPPUNIT_ASSERT_EQUAL(
+        osl::FileBase::E_None,
+        osl::File::copy(m_directories.getURLFromSrc(DATA_DIRECTORY) + sFileName, rURL));
 
     SfxMedium aSrcMed(rURL, StreamMode::STD_READ);
     SwDoc* pDoc = createDoc();


More information about the Libreoffice-commits mailing list