.gitignore | 1 + sc/qa/unit/filters-test.cxx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit dde2c5e5dcdbdebc61ab40586fb6b6451884a647 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Oct 18 13:31:58 2011 +0100 ignore callcatcher dirs diff --git a/.gitignore b/.gitignore index b4fe3c2..e102c36 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ /*/unxand?.pro /*/unx*.obsolete /*/wnt*.obsolete +/*/callcatcher /workdir /solver /instsetoo_native/util/LibreOffice commit 87c2fd70ae2796ab3e964bd80592ef9ee5329fef Author: Caolán McNamara <caol...@redhat.com> Date: Tue Oct 18 13:26:15 2011 +0100 Fix E_ACCESS failure under windows on attempt to remove temp qa data file The reference counting of ScDocShell is very confused. It starts off with ref count of 1, assigning it to a ScDocShellRef gives it a refcount of 2, so clearing it or its dtor gives a refcount of 1 again, so it doesn't auto-delete, and so doesn't close its stream, so the attempt to remove its stream gives E_ACCESS under windows. diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 878d4bc..68885a5 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -216,8 +216,11 @@ ScDocShellRef ScFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUStr SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READWRITE, true); pSrcMed->SetFilter(aFilter); if (!xDocShRef->DoLoad(pSrcMed)) + { + xDocShRef->DoClose(); // load failed. xDocShRef.Clear(); + } else if (nFormatType) { pSrcMed->GetItemSet()->Put( SfxUInt16Item( SID_MACROEXECMODE, 4)); @@ -230,7 +233,12 @@ ScDocShellRef ScFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUStr bool ScFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData) { - return load(rFilter, rURL, rUserData, rtl::OUString()).Is(); + ScDocShellRef xDocShRef = load(rFilter, rURL, rUserData, rtl::OUString()); + bool bLoaded = xDocShRef.Is(); + //reference counting of ScDocShellRef is very confused. + if (bLoaded) + xDocShRef->DoClose(); + return bLoaded; } void ScFiltersTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath)
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits