[Libreoffice-commits] core.git: 2 commits - chart2/qa include/unotools oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Dec 14 02:16:11 PST 2013


 chart2/qa/extras/chart2export.cxx |    4 ++--
 chart2/qa/extras/charttest.hxx    |   19 +++++++++++--------
 include/unotools/tempfile.hxx     |    4 ++++
 oox/source/export/chartexport.cxx |    4 +++-
 4 files changed, 20 insertions(+), 11 deletions(-)

New commits:
commit 007bf2b8c04090920b54e914ac75fc13720b450c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Dec 14 11:14:39 2013 +0100

    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:
commit af7b4eca3db99a63202df285a7df7402e523ff54
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Dec 14 11:13:52 2013 +0100

    silence cppcheck
    
    Change-Id: Iea597af9335aa6314a9465ec61cbaae9867a4cf4

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 0c06208..17a86ff6 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -85,6 +85,8 @@
 #include "ColorPropertySet.hxx"
 #include <set>
 
+#include <rtl/math.hxx>
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::drawing;
@@ -1819,7 +1821,7 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen
             FSEND );
         pFS->startElement( FSNS( XML_c, XML_v ),
             FSEND );
-        if (aValues[i] == aValues[i])
+        if (!rtl::math::isNan(aValues[i]))
             pFS->write( aValues[i] );
         pFS->endElement( FSNS( XML_c, XML_v ) );
         pFS->endElement( FSNS( XML_c, XML_pt ) );


More information about the Libreoffice-commits mailing list