utl::TempFile should not be copied

Change-Id: I35d0c96d52b490ef70a0238e715d874f0ecd1012
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 6c0f549..8088894 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -85,10 +85,10 @@ void Chart2ExportTest::test()

xmlDocPtr Chart2ExportTest::parseExport(const OUString& rStreamName, const OUString& rFilterFormat)
{
    utl::TempFile aTempFile = reload(rFilterFormat);
    boost::shared_ptr<utl::TempFile> pTempFile = reload(rFilterFormat);

    // Read the XML stream we're interested in.
    uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), aTempFile.GetURL());
    uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), pTempFile->GetURL());
    uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(rStreamName), uno::UNO_QUERY);
    CPPUNIT_ASSERT(xInputStream.is());
    boost::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, sal_True));
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index b50f4fd..def88c3 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -43,6 +43,9 @@
#include <libxml/xmlwriter.h>
#include <libxml/xpath.h>

#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>

using namespace com::sun::star;
using namespace com::sun::star::uno;

@@ -51,7 +54,7 @@ class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest
{
public:
    void load( const OUString& rDir, const OUString& rFileName );
    utl::TempFile reload( const OUString& rFileName );
    boost::shared_ptr<utl::TempFile> reload( const OUString& rFileName );
    uno::Sequence < OUString > getImpressChartColumnDescriptions( const char* pDir, const char* pName );
    OUString getFileExtension( const OUString& rFileName );

@@ -88,20 +91,20 @@ void ChartTest::load( const OUString& aDir, const OUString& aName )
    CPPUNIT_ASSERT(mxComponent.is());
}

utl::TempFile ChartTest::reload(const OUString& rFilterName)
boost::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
{
    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
    uno::Sequence<beans::PropertyValue> aArgs(1);
    aArgs[0].Name = "FilterName";
    aArgs[0].Value <<= rFilterName;
    utl::TempFile aTempFile;
    aTempFile.EnableKillingFile();
    xStorable->storeToURL(aTempFile.GetURL(), aArgs);
    boost::shared_ptr<utl::TempFile> pTempFile = boost::make_shared<utl::TempFile>();
    pTempFile->EnableKillingFile();
    xStorable->storeToURL(pTempFile->GetURL(), aArgs);
    mxComponent->dispose();
    mxComponent = loadFromDesktop(aTempFile.GetURL(), maServiceName);
    std::cout << aTempFile.GetURL();
    mxComponent = loadFromDesktop(pTempFile->GetURL(), maServiceName);
    std::cout << pTempFile->GetURL();
    CPPUNIT_ASSERT(mxComponent.is());
    return aTempFile;
    return pTempFile;
}

void ChartTest::setUp()
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 85eda3d..26c0581 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -49,6 +49,10 @@ class UNOTOOLS_DLLPUBLIC TempFile
    TempFile_Impl*  pImp;
    bool            bKillingFileEnabled;

    // prevent copy c'tor
    TempFile( const TempFile& );
    TempFile& operator=(const TempFile&);

protected:

public: