[Libreoffice-commits] .: 3 commits - sw/qa tools/inc unusedcode.easy xmlreader/inc xmlreader/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Oct 27 12:29:37 PDT 2012


 sw/qa/extras/rtfexport/rtfexport.cxx  |    2 --
 tools/inc/poly.h                      |    6 +++---
 tools/inc/tools/date.hxx              |    2 +-
 tools/inc/tools/datetime.hxx          |    2 +-
 tools/inc/tools/fract.hxx             |    2 +-
 tools/inc/tools/poly.hxx              |    6 +++---
 tools/inc/tools/time.hxx              |    2 +-
 tools/inc/tools/unqidx.hxx            |    2 +-
 unusedcode.easy                       |    1 -
 xmlreader/inc/xmlreader/xmlreader.hxx |    6 ------
 xmlreader/source/xmlreader.cxx        |   23 ++---------------------
 11 files changed, 13 insertions(+), 41 deletions(-)

New commits:
commit bb90189d7cf45277edb9d907c2468848074652c4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Oct 27 20:24:49 2012 +0100

    sprinkle some more SAL_WARN_UNUSED around
    
    Change-Id: Iaa1508584f005cba6e2ab63d4053cde4ce8637df

diff --git a/tools/inc/poly.h b/tools/inc/poly.h
index e71ba55..a925f9b 100644
--- a/tools/inc/poly.h
+++ b/tools/inc/poly.h
@@ -21,7 +21,7 @@
 
 #include <tools/gen.hxx>
 
-class ImplPolygonData
+class SAL_WARN_UNUSED ImplPolygonData
 {
 public:
     Point*          mpPointAry;
@@ -30,7 +30,7 @@ public:
     sal_uIntPtr           mnRefCount;
 };
 
-class ImplPolygon  : public ImplPolygonData
+class SAL_WARN_UNUSED ImplPolygon  : public ImplPolygonData
 {
 public:
                     ImplPolygon( sal_uInt16 nInitSize, sal_Bool bFlags = sal_False );
@@ -48,7 +48,7 @@ public:
 class Polygon;
 typedef Polygon* SVPPOLYGON;
 
-class ImplPolyPolygon
+class SAL_WARN_UNUSED ImplPolyPolygon
 {
 public:
     SVPPOLYGON*     mpPolyAry;
diff --git a/tools/inc/tools/date.hxx b/tools/inc/tools/date.hxx
index dbb40be..42c7c16 100644
--- a/tools/inc/tools/date.hxx
+++ b/tools/inc/tools/date.hxx
@@ -27,7 +27,7 @@ class ResId;
 enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,
                  SATURDAY, SUNDAY };
 
-class TOOLS_DLLPUBLIC Date
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Date
 {
 private:
     sal_uInt32      nDate;
diff --git a/tools/inc/tools/datetime.hxx b/tools/inc/tools/datetime.hxx
index 5d40dfe..0a79934 100644
--- a/tools/inc/tools/datetime.hxx
+++ b/tools/inc/tools/datetime.hxx
@@ -24,7 +24,7 @@
 #include <tools/date.hxx>
 #include <tools/time.hxx>
 
-class TOOLS_DLLPUBLIC DateTime : public Date, public Time
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED DateTime : public Date, public Time
 {
 public:
     enum DateTimeInitSystem
diff --git a/tools/inc/tools/fract.hxx b/tools/inc/tools/fract.hxx
index 0bf04b2..24c6721 100644
--- a/tools/inc/tools/fract.hxx
+++ b/tools/inc/tools/fract.hxx
@@ -24,7 +24,7 @@
 
 class SvStream;
 
-class TOOLS_DLLPUBLIC Fraction
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Fraction
 {
 private:
     long            nNumerator;
diff --git a/tools/inc/tools/poly.hxx b/tools/inc/tools/poly.hxx
index 8eb095e..fc6c57e 100644
--- a/tools/inc/tools/poly.hxx
+++ b/tools/inc/tools/poly.hxx
@@ -53,7 +53,7 @@ enum PolyFlags
 };
 #endif
 
-class PolyOptimizeData
+class SAL_WARN_UNUSED PolyOptimizeData
 {
 private:
 
@@ -81,7 +81,7 @@ namespace basegfx
     class B2DPolyPolygon;
 }
 
-class TOOLS_DLLPUBLIC Polygon
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Polygon
 {
 private:
     ImplPolygon*        mpImplPolygon;
@@ -194,7 +194,7 @@ public:
     explicit Polygon(const ::basegfx::B2DPolygon& rPolygon);
 };
 
-class TOOLS_DLLPUBLIC PolyPolygon
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED PolyPolygon
 {
 private:
     ImplPolyPolygon*    mpImplPolyPolygon;
diff --git a/tools/inc/tools/time.hxx b/tools/inc/tools/time.hxx
index 05c6d1e..fe58510 100644
--- a/tools/inc/tools/time.hxx
+++ b/tools/inc/tools/time.hxx
@@ -30,7 +30,7 @@ class ResId;
            25 hours or 10 minus 20 seconds being (non-negative) 10 seconds.
 */
 
-class TOOLS_DLLPUBLIC Time
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Time
 {
 private:
     sal_Int32       nTime;
diff --git a/tools/inc/tools/unqidx.hxx b/tools/inc/tools/unqidx.hxx
index 18088ef..3a3ba97 100644
--- a/tools/inc/tools/unqidx.hxx
+++ b/tools/inc/tools/unqidx.hxx
@@ -26,7 +26,7 @@
 
 #define UNIQUEINDEX_ENTRY_NOTFOUND   CONTAINER_ENTRY_NOTFOUND
 
-class TOOLS_DLLPUBLIC UniqueIndexImpl : public std::map<sal_uInt32, void*>
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED UniqueIndexImpl : public std::map<sal_uInt32, void*>
 {
 private:
     sal_uIntPtr   nStartIndex;
commit 2914d52fdf6ef3b672190ccbb2c8be5a6760187e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Oct 27 20:16:33 2012 +0100

    remove xmlreader from string now I don't need it anymore
    
    Change-Id: I8d280a5fa352bf4514a5e593b34be767648f4e64

diff --git a/unusedcode.easy b/unusedcode.easy
index bb758da..3ebbdd6 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -80,7 +80,6 @@ comphelper::detail::ConfigurationWrapper::getGroupReadWrite(boost::shared_ptr<co
 comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(rtl::OUString const&) const
 comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&, com::sun::star::uno::Any const&) const
 connectivity::file::OStatement_Base::reset()
-connectivity::mork::MQueryHelper::next()
 connectivity::mork::MQueryHelperResultEntry::insert(rtl::OString const&, rtl::OUString&)
 connectivity::mork::OColumnAlias::OColumnAlias()
 connectivity::mozab::MQueryHelper::next()
diff --git a/xmlreader/inc/xmlreader/xmlreader.hxx b/xmlreader/inc/xmlreader/xmlreader.hxx
index 1d3faf0..b6de027 100644
--- a/xmlreader/inc/xmlreader/xmlreader.hxx
+++ b/xmlreader/inc/xmlreader/xmlreader.hxx
@@ -44,10 +44,6 @@ public:
             com::sun::star::container::NoSuchElementException,
             com::sun::star::uno::RuntimeException));
 
-    //string is not copied so must persist for lifetime
-    //of XmlReader
-    explicit XmlReader(const char * str, sal_uInt64 len) SAL_THROW(());
-
     ~XmlReader();
 
     enum { NAMESPACE_NONE = -2, NAMESPACE_UNKNOWN = -1, NAMESPACE_XML = 0 };
@@ -174,8 +170,6 @@ private:
 
     SAL_DLLPRIVATE int toNamespaceId(NamespaceIris::size_type pos);
 
-    SAL_DLLPRIVATE void init();
-
     rtl::OUString fileUrl_;
     oslFileHandle fileHandle_;
     sal_uInt64 fileSize_;
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx
index e297cd1..fcf6e15 100644
--- a/xmlreader/source/xmlreader.cxx
+++ b/xmlreader/source/xmlreader.cxx
@@ -96,38 +96,19 @@ XmlReader::XmlReader(rtl::OUString const & fileUrl)
              rtl::OUString::valueOf(static_cast< sal_Int32 >(e)) + ")"),
             css::uno::Reference< css::uno::XInterface >());
     }
-    init();
-    pos_ = static_cast< char * >(fileAddress_);
-    end_ = pos_ + fileSize_;
-}
-
-XmlReader::XmlReader(const char * str, sal_uInt64 len)
-    SAL_THROW(())
-    : fileHandle_(NULL)
-    , fileSize_(len)
-    , fileAddress_(NULL)
-{
-    init();
-    pos_ = str;
-    end_ = pos_ + fileSize_;
-}
-
-void XmlReader::init()
-{
     namespaceIris_.push_back(
         Span(
             RTL_CONSTASCII_STRINGPARAM(
                 "http://www.w3.org/XML/1998/namespace")));
     namespaces_.push_back(
         NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xml")), NAMESPACE_XML));
+    pos_ = static_cast< char * >(fileAddress_);
+    end_ = pos_ + fileSize_;
     state_ = STATE_CONTENT;
     firstAttribute_ = true;
 }
 
 XmlReader::~XmlReader() {
-    if (!fileHandle_)
-        return;
-
     oslFileError e = osl_unmapMappedFile(fileHandle_, fileAddress_, fileSize_);
     if (e != osl_File_E_None) {
         SAL_WARN(
commit 1692cf6854ff7adbb2bd47f2f7ec2b3de51864f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Oct 27 16:50:37 2012 +0100

    drop unnecessary usings
    
    Change-Id: I65b7c81a45925894ef78f141219fd00652ad5c1d

diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index bd3f273..9601471 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -37,8 +37,6 @@
 #include <unotools/tempfile.hxx>
 #include <vcl/svapp.hxx>
 
-using rtl::OString;
-using rtl::OUString;
 using rtl::OUStringBuffer;
 
 class Test : public SwModelTestBase


More information about the Libreoffice-commits mailing list