[Libreoffice-commits] .: 2 commits - sc/inc sc/source unotools/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Tue Nov 29 11:03:50 PST 2011


 sc/inc/nameuno.hxx                      |    5 +++--
 sc/source/ui/unoobj/nameuno.cxx         |    4 ++--
 unotools/source/ucbhelper/ucbhelper.cxx |   15 +++++++--------
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit d3c772229cf93ecb1296a67f4ddf5e73afe41b7e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 29 20:03:10 2011 +0100

    Use rtl::Reference<>.

diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx
index 4872373..a83748c 100644
--- a/sc/inc/nameuno.hxx
+++ b/sc/inc/nameuno.hxx
@@ -49,6 +49,7 @@
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implbase5.hxx>
 #include <cppuhelper/implbase6.hxx>
+#include <rtl/ref.hxx>
 
 class ScDocShell;
 class ScRangeName;
@@ -67,7 +68,7 @@ class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
                         public SfxListener
 {
 private:
-    com::sun::star::uno::Reference< com::sun::star::sheet::XNamedRanges > mxParent;
+    rtl::Reference< ScNamedRangesObj > mxParent;
     ScDocShell*             pDocShell;
     String                  aName;
     com::sun::star::uno::Reference< com::sun::star::container::XNamed > mxSheet;
@@ -81,7 +82,7 @@ private:
     SCTAB                   GetTab_Impl();
 
 public:
-                            ScNamedRangeObj( com::sun::star::uno::Reference< com::sun::star::sheet::XNamedRanges > xParent, ScDocShell* pDocSh, const String& rNm,
+                            ScNamedRangeObj( rtl::Reference< ScNamedRangesObj > xParent, ScDocShell* pDocSh, const String& rNm,
                                     com::sun::star::uno::Reference< com::sun::star::container::XNamed > xSheet = com::sun::star::uno::Reference< com::sun::star::container::XNamed > ());
     virtual                 ~ScNamedRangeObj();
 
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 3facf43..60f3025 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -97,7 +97,7 @@ bool lcl_UserVisibleName(const ScRangeData& rData)
     return !rData.HasType(RT_DATABASE) && !rData.HasType(RT_SHARED);
 }
 
-ScNamedRangeObj::ScNamedRangeObj( Reference< sheet::XNamedRanges > xParent, ScDocShell* pDocSh, const String& rNm, Reference<container::XNamed> xSheet):
+ScNamedRangeObj::ScNamedRangeObj( rtl::Reference< ScNamedRangesObj > xParent, ScDocShell* pDocSh, const String& rNm, Reference<container::XNamed> xSheet):
     mxParent(xParent),
     pDocShell( pDocSh ),
     aName( rNm ),
@@ -213,7 +213,7 @@ void ScNamedRangeObj::Modify_Impl( const String* pNewName, const ScTokenArray* p
     if (pNewRanges->insert(pNew))
     {
         ScDocFunc aFunc(*pDocShell);
-        aFunc.SetNewRangeNames(pNewRanges, dynamic_cast<ScNamedRangesObj*>(mxParent.get())->IsModifyAndBroadcast(), nTab);
+        aFunc.SetNewRangeNames(pNewRanges, mxParent->IsModifyAndBroadcast(), nTab);
 
         aName = aInsName;   //! broadcast?
     }
commit ca6052b9a62596902f901f8fa36680d7abe989f5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 29 20:02:50 2011 +0100

    Special casing can be removed again.

diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index 935620f..8487816 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -483,9 +483,6 @@ bool utl::UCBContentHelper::IsSubPath(
 bool utl::UCBContentHelper::EqualURLs(
     rtl::OUString const & url1, rtl::OUString const & url2)
 {
-    if (url1.isEmpty() || url2.isEmpty()) {
-        return false;
-    }
     ucbhelper::ContentBroker * broker = ucbhelper::ContentBroker::get();
     if (broker == 0) {
         throw css::uno::RuntimeException(
@@ -493,11 +490,13 @@ bool utl::UCBContentHelper::EqualURLs(
                 RTL_CONSTASCII_USTRINGPARAM("no ucbhelper::ContentBroker")),
             css::uno::Reference<css::uno::XInterface>());
     }
-    return 0 == broker->getContentProviderInterface()->compareContentIds(
-        (broker->getContentIdentifierFactoryInterface()->
-         createContentIdentifier(canonic(url1))),
-        (broker->getContentIdentifierFactoryInterface()->
-         createContentIdentifier(canonic(url2))));
+    return
+        broker->getContentProviderInterface()->compareContentIds(
+            (broker->getContentIdentifierFactoryInterface()->
+             createContentIdentifier(canonic(url1))),
+            (broker->getContentIdentifierFactoryInterface()->
+             createContentIdentifier(canonic(url2))))
+        == 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list