[Libreoffice-commits] core.git: 2 commits - accessibility/inc accessibility/source compilerplugins/clang editeng/source forms/source include/editeng include/svx svx/source sw/source unotools/source

Stephan Bergmann sbergman at redhat.com
Fri Jul 15 14:08:41 UTC 2016


 accessibility/inc/standard/vclxaccessiblelistitem.hxx    |    1 
 accessibility/source/standard/vclxaccessiblelistitem.cxx |    5 -
 compilerplugins/clang/unnecessaryoverride.cxx            |   62 +++++++++++++--
 editeng/source/uno/unopracc.cxx                          |    6 -
 forms/source/component/Currency.cxx                      |    6 -
 forms/source/component/Currency.hxx                      |    3 
 forms/source/component/Numeric.cxx                       |    7 -
 forms/source/component/Numeric.hxx                       |    3 
 forms/source/component/Pattern.cxx                       |    7 -
 forms/source/component/Pattern.hxx                       |    3 
 include/editeng/unopracc.hxx                             |    1 
 include/svx/fmdpage.hxx                                  |    3 
 include/svx/unoshape.hxx                                 |   23 -----
 svx/source/form/fmdpage.cxx                              |    7 -
 svx/source/unodraw/unoshap2.cxx                          |   54 -------------
 svx/source/unodraw/unoshap3.cxx                          |    7 -
 sw/source/uibase/uno/unotxdoc.cxx                        |    9 --
 unotools/source/ucbhelper/XTempFile.hxx                  |    2 
 unotools/source/ucbhelper/xtempfile.cxx                  |    5 -
 19 files changed, 58 insertions(+), 156 deletions(-)

New commits:
commit 018e89337d18e5aa153faae5b3df41188d1c174c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 15 12:26:27 2016 +0200

    Improve loplugin:unnecessaryoverride
    
    <sberg> thorsten, remember what that "TODO" in
     SvxAccessibleTextPropertySet::getSupportedServiceNames was to be about exactly,
     in a909acb7009acadffa53e74ea05ddb88803490f1 ?
    <thorsten> sberg: that's a nonsense, prolly copy'n'pasted, or a 'please review
     me'
    <sberg> thorsten, OK, thanks (that override will eventually go away with
     loplugin:unnecessaryoverride, and the TODO comment be lost)
    
    Change-Id: Iba964c61768459aac4067bbd4e1f7d4f78f6adac
    Reviewed-on: https://gerrit.libreoffice.org/27232
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/accessibility/inc/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/standard/vclxaccessiblelistitem.hxx
index 1fa8074..0e19c3c 100644
--- a/accessibility/inc/standard/vclxaccessiblelistitem.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelistitem.hxx
@@ -108,7 +108,6 @@ public:
     virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException, std::exception) override;
 
     // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw (css::uno::RuntimeException, std::exception) override;
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override;
 
     // XServiceInfo
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx
index 1cc7b37..52724e64 100644
--- a/accessibility/source/standard/vclxaccessiblelistitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx
@@ -153,11 +153,6 @@ Any SAL_CALL VCLXAccessibleListItem::queryInterface( Type const & rType ) throw
 
 // XTypeProvider
 
-Sequence< Type > SAL_CALL VCLXAccessibleListItem::getTypes(  ) throw (RuntimeException, std::exception)
-{
-    return VCLXAccessibleListItem_BASE::getTypes();
-}
-
 Sequence< sal_Int8 > VCLXAccessibleListItem::getImplementationId() throw (RuntimeException, std::exception)
 {
     return css::uno::Sequence<sal_Int8>();
diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx
index 8a882af..06a468c 100644
--- a/compilerplugins/clang/unnecessaryoverride.cxx
+++ b/compilerplugins/clang/unnecessaryoverride.cxx
@@ -12,6 +12,8 @@
 #include <iostream>
 #include <fstream>
 #include <set>
+
+#include "compat.hxx"
 #include "plugin.hxx"
 
 /**
@@ -67,16 +69,61 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
 
     const CXXMethodDecl* overriddenMethodDecl = *methodDecl->begin_overridden_methods();
 
+    if (compat::getReturnType(*methodDecl).getCanonicalType()
+        != compat::getReturnType(*overriddenMethodDecl).getCanonicalType())
+    {
+        return true;
+    }
+    //TODO: check for identical exception specifications
+
     const CompoundStmt* compoundStmt = dyn_cast<CompoundStmt>(methodDecl->getBody());
     if (!compoundStmt || compoundStmt->size() != 1)
         return true;
-    const Stmt* firstStmt = compoundStmt->body_front();
-    if (const ReturnStmt* returnStmt = dyn_cast<ReturnStmt>(firstStmt)) {
-        firstStmt = returnStmt->getRetValue();
+    auto returnStmt = dyn_cast<ReturnStmt>(compoundStmt->body_front());
+    if (returnStmt == nullptr) {
+        return true;
     }
-    if (!firstStmt)
+    auto returnExpr = returnStmt->getRetValue();
+    if (returnExpr == nullptr) {
         return true;
-    const CXXMemberCallExpr* callExpr = dyn_cast<CXXMemberCallExpr>(firstStmt);
+    }
+    returnExpr = returnExpr->IgnoreImplicit();
+
+    // In something like
+    //
+    //  Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery(
+    //      const rtl::OUString& sql)
+    //      throw(SQLException, RuntimeException, std::exception)
+    //  {
+    //      return OCommonStatement::executeQuery( sql );
+    //  }
+    //
+    // look down through all the
+    //
+    //   ReturnStmt
+    //   `-ExprWithCleanups
+    //     `-CXXConstructExpr
+    //      `-MaterializeTemporaryExpr
+    //       `-ImplicitCastExpr
+    //        `-CXXBindTemporaryExpr
+    //         `-CXXMemberCallExpr
+    //
+    // where the fact that the overriding and overridden function have identical
+    // return types makes us confident that all we need to check here is whether
+    // there's an (arbitrary, one-argument) CXXConstructorExpr and
+    // CXXBindTemporaryExpr in between:
+    if (auto ctorExpr = dyn_cast<CXXConstructExpr>(returnExpr)) {
+        if (ctorExpr->getNumArgs() == 1) {
+            if (auto tempExpr = dyn_cast<CXXBindTemporaryExpr>(
+                    ctorExpr->getArg(0)->IgnoreImplicit()))
+            {
+                returnExpr = tempExpr->getSubExpr();
+            }
+        }
+    }
+
+    const CXXMemberCallExpr* callExpr = dyn_cast<CXXMemberCallExpr>(
+        returnExpr->IgnoreParenImpCasts());
     if (!callExpr || callExpr->getMethodDecl() != overriddenMethodDecl)
         return true;
     const ImplicitCastExpr* expr1 = dyn_cast_or_null<ImplicitCastExpr>(callExpr->getImplicitObjectArgument());
@@ -92,9 +139,10 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
     }
 
     report(
-        DiagnosticsEngine::Warning, "method just calls parent method",
+        DiagnosticsEngine::Warning, "%0 virtual function just calls %1 parent",
         methodDecl->getSourceRange().getBegin())
-      << methodDecl->getSourceRange();
+        << methodDecl->getAccess() << overriddenMethodDecl->getAccess()
+        << methodDecl->getSourceRange();
     if (methodDecl->getCanonicalDecl()->getLocation() != methodDecl->getLocation()) {
         const CXXMethodDecl* pOther = methodDecl->getCanonicalDecl();
         report(
diff --git a/editeng/source/uno/unopracc.cxx b/editeng/source/uno/unopracc.cxx
index 0f2a5fe..bae44d0 100644
--- a/editeng/source/uno/unopracc.cxx
+++ b/editeng/source/uno/unopracc.cxx
@@ -111,10 +111,4 @@ sal_Bool SAL_CALL SvxAccessibleTextPropertySet::supportsService (const OUString&
     return cppu::supportsService(this, sServiceName);
 }
 
-uno::Sequence< OUString> SAL_CALL SvxAccessibleTextPropertySet::getSupportedServiceNames() throw (uno::RuntimeException, std::exception)
-{
-    // TODO
-    return SvxUnoTextRangeBase::getSupportedServiceNames();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx
index 0b176e3..fe0005a 100644
--- a/forms/source/component/Currency.cxx
+++ b/forms/source/component/Currency.cxx
@@ -45,12 +45,6 @@ OCurrencyControl::OCurrencyControl(const Reference<XComponentContext>& _rxFactor
 {
 }
 
-Sequence<Type> OCurrencyControl::_getTypes()
-{
-    return OBoundControl::_getTypes();
-}
-
-
 css::uno::Sequence<OUString> SAL_CALL OCurrencyControl::getSupportedServiceNames() throw(std::exception)
 {
     css::uno::Sequence<OUString> aSupported = OBoundControl::getSupportedServiceNames();
diff --git a/forms/source/component/Currency.hxx b/forms/source/component/Currency.hxx
index dee2e9f..2a61cd3 100644
--- a/forms/source/component/Currency.hxx
+++ b/forms/source/component/Currency.hxx
@@ -69,9 +69,6 @@ protected:
 
 class OCurrencyControl: public OBoundControl
 {
-protected:
-    virtual css::uno::Sequence< css::uno::Type> _getTypes() override;
-
 public:
     explicit OCurrencyControl(const css::uno::Reference< css::uno::XComponentContext>& _rxContext);
     // css::lang::XServiceInfo
diff --git a/forms/source/component/Numeric.cxx b/forms/source/component/Numeric.cxx
index 3ab288f..76a9156 100644
--- a/forms/source/component/Numeric.cxx
+++ b/forms/source/component/Numeric.cxx
@@ -53,13 +53,6 @@ css::uno::Sequence<OUString> ONumericControl::getSupportedServiceNames() throw(s
     return aSupported;
 }
 
-
-Sequence<Type> ONumericControl::_getTypes()
-{
-    return OBoundControl::_getTypes();
-}
-
-
 // ONumericModel
 
 Sequence<Type> ONumericModel::_getTypes()
diff --git a/forms/source/component/Numeric.hxx b/forms/source/component/Numeric.hxx
index e883e1e..1403ee1 100644
--- a/forms/source/component/Numeric.hxx
+++ b/forms/source/component/Numeric.hxx
@@ -68,9 +68,6 @@ protected:
 
 class ONumericControl: public OBoundControl
 {
-protected:
-    virtual css::uno::Sequence< css::uno::Type> _getTypes() override;
-
 public:
     explicit ONumericControl(const css::uno::Reference< css::uno::XComponentContext>& _rxFactory);
 
diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx
index e0d54db..ba27f23 100644
--- a/forms/source/component/Pattern.cxx
+++ b/forms/source/component/Pattern.cxx
@@ -41,13 +41,6 @@ OPatternControl::OPatternControl(const Reference<XComponentContext>& _rxFactory)
 {
 }
 
-
-Sequence<Type> OPatternControl::_getTypes()
-{
-    return OBoundControl::_getTypes();
-}
-
-
 css::uno::Sequence<OUString> OPatternControl::getSupportedServiceNames() throw(std::exception)
 {
     css::uno::Sequence<OUString> aSupported = OBoundControl::getSupportedServiceNames();
diff --git a/forms/source/component/Pattern.hxx b/forms/source/component/Pattern.hxx
index 65e4d0d..6600e91 100644
--- a/forms/source/component/Pattern.hxx
+++ b/forms/source/component/Pattern.hxx
@@ -75,9 +75,6 @@ protected:
 
 class OPatternControl: public OBoundControl
 {
-protected:
-    virtual css::uno::Sequence< css::uno::Type> _getTypes() override;
-
 public:
     explicit OPatternControl(const css::uno::Reference< css::uno::XComponentContext>& _rxFactory);
 
diff --git a/include/editeng/unopracc.hxx b/include/editeng/unopracc.hxx
index 0ab543b..b1e8620 100644
--- a/include/editeng/unopracc.hxx
+++ b/include/editeng/unopracc.hxx
@@ -49,7 +49,6 @@ public:
     // lang::XServiceInfo
     virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override;
     virtual sal_Bool SAL_CALL supportsService( const OUString& ) throw (css::uno::RuntimeException, std::exception) override;
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override;
 
     // lang::XTypeProvider
     virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw(css::uno::RuntimeException, std::exception) override;
diff --git a/include/svx/fmdpage.hxx b/include/svx/fmdpage.hxx
index 1d55f53..dd9397e 100644
--- a/include/svx/fmdpage.hxx
+++ b/include/svx/fmdpage.hxx
@@ -59,9 +59,6 @@ public:
 
     // XFormsSupplier2
     virtual sal_Bool SAL_CALL hasForms() throw( css::uno::RuntimeException, std::exception ) override;
-
-    // css::lang::XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
 };
 
 #endif // INCLUDED_SVX_FMDPAGE_HXX
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 71cc3ca..496c338 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -434,11 +434,7 @@ public:
     virtual void SAL_CALL enterGroup(  ) throw(css::uno::RuntimeException, std::exception) override;
     virtual void SAL_CALL leaveGroup(  ) throw(css::uno::RuntimeException, std::exception) override;
 
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
-
     // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw(css::uno::RuntimeException, std::exception) override;
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(css::uno::RuntimeException, std::exception) override;
 };
 #include <com/sun/star/drawing/XConnectorShape.hpp>
@@ -474,9 +470,6 @@ public:
     virtual void SAL_CALL disconnectBegin( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) throw(css::uno::RuntimeException, std::exception) override;
     virtual void SAL_CALL disconnectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) throw(css::uno::RuntimeException, std::exception) override;
 
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
-
     // XTypeProvider
     virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw(css::uno::RuntimeException, std::exception) override;
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(css::uno::RuntimeException, std::exception) override;
@@ -524,9 +517,6 @@ public:
     virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() throw(css::uno::RuntimeException, std::exception) override;
     virtual void SAL_CALL setControl( const css::uno::Reference< css::awt::XControlModel >& xControl ) throw(css::uno::RuntimeException, std::exception) override;
 
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
-
     // XTypeProvider
     virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw(css::uno::RuntimeException, std::exception) override;
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(css::uno::RuntimeException, std::exception) override;
@@ -540,9 +530,6 @@ class SvxShapeDimensioning : public SvxShapeText
 public:
     SvxShapeDimensioning( SdrObject* pObj ) throw();
     virtual ~SvxShapeDimensioning() throw();
-
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
 };
 
 /***********************************************************************
@@ -553,9 +540,6 @@ class SvxShapeCircle : public SvxShapeText
 public:
     SvxShapeCircle( SdrObject* pObj ) throw ();
     virtual ~SvxShapeCircle() throw ();
-
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
 };
 
 /***********************************************************************
@@ -613,9 +597,6 @@ public:
     css::drawing::PolygonKind GetPolygonKind() const throw() { return mePolygonKind;}
     void SetPolygon(const basegfx::B2DPolyPolygon& rNew) throw(css::uno::RuntimeException);
     basegfx::B2DPolyPolygon GetPolygon() const throw();
-
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
 };
 
 /***********************************************************************
@@ -643,9 +624,6 @@ public:
     css::drawing::PolygonKind GetPolygonKind() const throw() { return mePolygonKind;}
     void SetPolygon(const basegfx::B2DPolyPolygon & rNew) throw(css::uno::RuntimeException);
     basegfx::B2DPolyPolygon GetPolygon() const throw();
-
-    // XServiceInfo
-    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
 };
 
 /***********************************************************************
@@ -716,7 +694,6 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
 
     // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw(css::uno::RuntimeException, std::exception) override;
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(css::uno::RuntimeException, std::exception) override;
 };
 
diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx
index 01aaed5..6438080 100644
--- a/svx/source/form/fmdpage.cxx
+++ b/svx/source/form/fmdpage.cxx
@@ -113,11 +113,4 @@ sal_Bool SAL_CALL SvxFmDrawPage::hasForms() throw( css::uno::RuntimeException, s
     return bHas;
 }
 
-// css::lang::XServiceInfo
-css::uno::Sequence< OUString > SAL_CALL SvxFmDrawPage::getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception )
-{
-    return SvxDrawPage::getSupportedServiceNames();
-}
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 9ba87e7..d83e6e93 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -129,12 +129,6 @@ void SAL_CALL SvxShapeGroup::release() throw ( )
     SvxShape::release();
 }
 
-uno::Sequence< uno::Type > SAL_CALL SvxShapeGroup::getTypes()
-    throw (uno::RuntimeException, std::exception)
-{
-    return SvxShape::getTypes();
-}
-
 uno::Sequence< sal_Int8 > SAL_CALL SvxShapeGroup::getImplementationId()
     throw (uno::RuntimeException, std::exception)
 {
@@ -367,14 +361,6 @@ sal_Bool SAL_CALL SvxShapeGroup::hasElements() throw( uno::RuntimeException, std
     return mpObj.is() && mpObj->GetSubList() && (mpObj->GetSubList()->GetObjCount() > 0);
 }
 
-
-// css::lang::XServiceInfo
-
-uno::Sequence< OUString > SAL_CALL SvxShapeGroup::getSupportedServiceNames()
-    throw(uno::RuntimeException, std::exception)
-{
-    return SvxShape::getSupportedServiceNames();
-}
 SvxShapeConnector::SvxShapeConnector( SdrObject* pObj )  throw() :
     SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONNECTOR), getSvxMapProvider().GetPropertySet(SVXMAP_CONNECTOR, SdrObject::GetGlobalDrawObjectItemPool()) )
 {
@@ -519,14 +505,6 @@ void SAL_CALL SvxShapeConnector::disconnectEnd( const uno::Reference< drawing::X
         mpModel->SetChanged();
 }
 
-
-// css::lang::XServiceInfo
-
-uno::Sequence< OUString > SAL_CALL SvxShapeConnector::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
-{
-    return SvxShapeText::getSupportedServiceNames();
-}
-
 SvxShapeControl::SvxShapeControl( SdrObject* pObj )  throw() :
     SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONTROL), getSvxMapProvider().GetPropertySet(SVXMAP_CONTROL, SdrObject::GetGlobalDrawObjectItemPool()) )
 {
@@ -643,12 +621,6 @@ void SAL_CALL SvxShapeControl::setControl( const Reference< awt::XControlModel >
         mpModel->SetChanged();
 }
 
-// XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapeControl::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
-{
-    return SvxShapeText::getSupportedServiceNames();
-}
-
 static struct
 {
     const sal_Char* mpAPIName;
@@ -991,11 +963,6 @@ SvxShapeDimensioning::~SvxShapeDimensioning() throw()
 {
 }
 
-// css::lang::XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapeDimensioning::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
-{
-    return SvxShapeText::getSupportedServiceNames();
-}
 SvxShapeCircle::SvxShapeCircle( SdrObject* pObj ) throw()
 :   SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CIRCLE), getSvxMapProvider().GetPropertySet(SVXMAP_CIRCLE, SdrObject::GetGlobalDrawObjectItemPool()) )
 {
@@ -1006,14 +973,6 @@ SvxShapeCircle::~SvxShapeCircle() throw()
 {
 }
 
-// css::lang::XServiceInfo
-// XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapeCircle::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
-{
-    return SvxShapeText::getSupportedServiceNames();
-}
-
-
 SvxShapePolyPolygon::SvxShapePolyPolygon( SdrObject* pObj , drawing::PolygonKind eNew )
  throw( css::beans::PropertyVetoException, css::lang::IllegalArgumentException)
 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_POLYPOLYGON), getSvxMapProvider().GetPropertySet(SVXMAP_POLYPOLYGON, SdrObject::GetGlobalDrawObjectItemPool()) )
@@ -1263,12 +1222,6 @@ basegfx::B2DPolyPolygon SvxShapePolyPolygon::GetPolygon() const throw()
     }
 }
 
-// css::lang::XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygon::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
-{
-    return SvxShapeText::getSupportedServiceNames();
-}
-
 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
 #include <com/sun/star/drawing/FlagSequence.hpp>
 
@@ -1386,13 +1339,6 @@ basegfx::B2DPolyPolygon SvxShapePolyPolygonBezier::GetPolygon() const throw()
     }
 }
 
-
-// css::lang::XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygonBezier::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
-{
-    return SvxShapeText::getSupportedServiceNames();
-}
-
 SvxGraphicObject::SvxGraphicObject( SdrObject* pObj, OUString const & referer ) throw()
 :   SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_GRAPHICOBJECT), getSvxMapProvider().GetPropertySet(SVXMAP_GRAPHICOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) ), referer_(referer)
 {
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 3a8f4a7..fe6505d 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -105,13 +105,6 @@ void SAL_CALL Svx3DSceneObject::release() throw ( )
 
 // XTypeProvider
 
-uno::Sequence< uno::Type > SAL_CALL Svx3DSceneObject::getTypes()
-    throw (uno::RuntimeException, std::exception)
-{
-
-    return SvxShape::getTypes();
-}
-
 uno::Sequence< sal_Int8 > SAL_CALL Svx3DSceneObject::getImplementationId()
     throw (uno::RuntimeException, std::exception)
 {
diff --git a/unotools/source/ucbhelper/XTempFile.hxx b/unotools/source/ucbhelper/XTempFile.hxx
index f50aeea..3ecd776 100644
--- a/unotools/source/ucbhelper/XTempFile.hxx
+++ b/unotools/source/ucbhelper/XTempFile.hxx
@@ -72,8 +72,6 @@ public:
     //  XTypeProvider
     virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  )
         throw (css::uno::RuntimeException, std::exception) override;
-    virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId(  )
-        throw (css::uno::RuntimeException, std::exception) override;
 
     //  XTempFile
     virtual sal_Bool SAL_CALL getRemoveFile()
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 9d1af59..aaf7a32 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -88,11 +88,6 @@ throw ( css::uno::RuntimeException, std::exception )
     }
     return pTypeCollection->getTypes();
 };
-css::uno::Sequence< sal_Int8 > SAL_CALL OTempFileService::getImplementationId(  )
-throw ( css::uno::RuntimeException, std::exception )
-{
-    return OTempFileBase::getImplementationId();
-}
 
 //  XTempFile
 
commit 5a3653f87502e40cf00d8f1ed1c0ecf5a979e67d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 15 12:02:57 2016 +0200

    sw lok: fix shape text editing with multiple views
    
    When changing the active view shell,
    sw::DocumentLayoutManager::GetCurrentViewShell() is not instantly
    updated, only when e.g. the focus changes. This means that calling
    setView() + paintTile() pairs on random views typically did not use the
    matching view shell, but the last one. This has a visible effect when
    editing shape text, as the non-text-edit views had the outdated shape
    text visible, unlike on the desktop.
    
    Fix the problem by using SwDocShell::GetWrtShell() instead.
    
    Change-Id: Ia4b67d0a8931692ed4fc5c5e97cc1a09ef81e647

diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index da2675e..9093b7d 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3132,16 +3132,14 @@ void SwXTextDocument::paintTile( VirtualDevice &rDevice,
                                  int nTilePosX, int nTilePosY,
                                  long nTileWidth, long nTileHeight )
 {
-    SwDoc* pDoc = pDocShell->GetDoc();
-    SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
+    SwViewShell* pViewShell = pDocShell->GetWrtShell();
     pViewShell->PaintTile(rDevice, nOutputWidth, nOutputHeight,
                           nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 }
 
 Size SwXTextDocument::getDocumentSize()
 {
-    SwDoc* pDoc = pDocShell->GetDoc();
-    SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
+    SwViewShell* pViewShell = pDocShell->GetWrtShell();
     Size aDocSize = pViewShell->GetDocSize();
 
     return Size(aDocSize.Width()  + 2L * DOCUMENTBORDER,
@@ -3262,8 +3260,7 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
 {
     SolarMutexGuard aGuard;
 
-    SwDoc* pDoc = pDocShell->GetDoc();
-    SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
+    SwViewShell* pViewShell = pDocShell->GetWrtShell();
 
     bool      bBookMode = false;
     sal_Int16 nColumns = 1;


More information about the Libreoffice-commits mailing list