Kaydet (Commit) 191f85df authored tarafından Noel Grandin's avatar Noel Grandin

re-land "new loplugin typedefparam""

This reverts commit c9bb4838,
and adds a bunch more fixes.

Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a
Reviewed-on: https://gerrit.libreoffice.org/68680
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 98356611
......@@ -211,9 +211,9 @@ private:
virtual void SAL_CALL grabFocus() override;
virtual css::util::Color SAL_CALL getForeground() override;
virtual sal_Int32 SAL_CALL getForeground() override;
virtual css::util::Color SAL_CALL getBackground() override;
virtual sal_Int32 SAL_CALL getBackground() override;
virtual ::sal_Int32 SAL_CALL getCaretPosition() override;
......
......@@ -275,13 +275,13 @@ void SAL_CALL Paragraph::grabFocus()
}
// virtual
css::util::Color SAL_CALL Paragraph::getForeground()
sal_Int32 SAL_CALL Paragraph::getForeground()
{
return 0; // TODO
}
// virtual
css::util::Color SAL_CALL Paragraph::getBackground()
sal_Int32 SAL_CALL Paragraph::getBackground()
{
return 0; // TODO
}
......
......@@ -26,8 +26,8 @@ namespace oglcanvas
void renderComplexPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly );
void renderPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly );
void setupState( const ::basegfx::B2DHomMatrix& rTransform,
unsigned int eSrcBlend,
unsigned int eDstBlend,
GLenum eSrcBlend,
GLenum eDstBlend,
const com::sun::star::rendering::ARGBColor& rColor );
void renderOSD( const std::vector<double>& rNumbers, double scale );
......
......@@ -87,7 +87,7 @@ namespace canvas
bool drawRectangularArea(
double fAlpha,
const ::basegfx::B2DPoint& rPos,
const ::basegfx::B2DRange& rArea,
const ::basegfx::B2DRectangle& rArea,
const ::basegfx::B2DHomMatrix& rTransform );
/** Render the surface content to screen.
......
......@@ -472,7 +472,7 @@ void InternalData::deleteRow( sal_Int32 nAtIndex )
dump();
}
void InternalData::setComplexRowLabels( const vector< vector< uno::Any > >& rNewRowLabels )
void InternalData::setComplexRowLabels( const tVecVecAny& rNewRowLabels )
{
m_aRowLabels = rNewRowLabels;
sal_Int32 nNewRowCount = static_cast< sal_Int32 >( m_aRowLabels.size() );
......@@ -487,7 +487,7 @@ const InternalData::tVecVecAny& InternalData::getComplexRowLabels() const
return m_aRowLabels;
}
void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& rNewColumnLabels )
void InternalData::setComplexColumnLabels( const tVecVecAny& rNewColumnLabels )
{
m_aColumnLabels = rNewColumnLabels;
sal_Int32 nNewColumnCount = static_cast< sal_Int32 >( m_aColumnLabels.size() );
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "tools/solar.h"
namespace test1
{
class Foo
{
void bar(sal_uIntPtr x); // expected-note {{declaration site here [loplugin:typedefparam]}}
sal_uIntPtr bar(); // expected-note {{declaration site here [loplugin:typedefparam]}}
};
void Foo::bar(sal_uLong)
// expected-error@-1 {{function param 0 at definition site does not match function param at declaration site, 'sal_uLong' (aka 'unsigned long') vs 'sal_uIntPtr' (aka 'unsigned long') [loplugin:typedefparam]}}
{
}
sal_uLong Foo::bar()
// expected-error@-1 {{function return type at definition site does not match function param at declaration site, 'sal_uLong' (aka 'unsigned long') vs 'sal_uIntPtr' (aka 'unsigned long') [loplugin:typedefparam]}}
{
return 1;
}
};
// Carve out an exception for the "typedef struct S {...} T" idiom we use in the UNO code
namespace test2
{
typedef struct Foo
{
int x;
} FooT;
void bar(struct Foo*);
void bar(FooT*){
// no warning expected
};
};
namespace test3
{
typedef struct Foo
{
int x;
} FooT;
void bar(Foo*);
void bar(FooT*){
// no warning expected
};
};
// check method overrides
namespace test4
{
struct Struct1
{
virtual sal_uIntPtr foo1();
// expected-note@-1 {{super-class method here [loplugin:typedefparam]}}
virtual void foo2(sal_uIntPtr);
// expected-note@-1 {{super-class method here [loplugin:typedefparam]}}
virtual ~Struct1();
};
struct Struct2 : public Struct1
{
virtual sal_uLong foo1() override;
// expected-error@-1 {{method return type does not match overridden method 'sal_uLong' (aka 'unsigned long') vs 'sal_uIntPtr' (aka 'unsigned long') [loplugin:typedefparam]}}
virtual void foo2(sal_uLong) override;
// expected-error@-1 {{method param 0 does not match overridden method param 'sal_uLong' (aka 'unsigned long') vs 'sal_uIntPtr' (aka 'unsigned long') [loplugin:typedefparam]}}
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
This diff is collapsed.
......@@ -88,7 +88,7 @@ private:
virtual sal_Bool SAL_CALL hasPendingChanges() override
{ return getRoot()->hasPendingChanges(); }
virtual css::util::ChangesSet SAL_CALL getPendingChanges() override
virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override
{ return getRoot()->getPendingChanges(); }
css::beans::Property SAL_CALL getPropertyByHierarchicalName(
......
......@@ -180,7 +180,7 @@ sal_Bool RootAccess::hasPendingChanges() {
return !changes.empty();
}
css::util::ChangesSet RootAccess::getPendingChanges()
css::uno::Sequence< ::css::util::ElementChange > RootAccess::getPendingChanges()
{
assert(thisIs(IS_UPDATE));
osl::MutexGuard g(*lock_);
......
......@@ -90,7 +90,7 @@ public:
virtual sal_Bool SAL_CALL hasPendingChanges() override;
virtual css::util::ChangesSet SAL_CALL getPendingChanges() override;
virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override;
private:
virtual ~RootAccess() override;
......
......@@ -60,7 +60,6 @@ namespace mysqlc
using ::com::sun::star::sdbc::SQLException;
using ::com::sun::star::sdbc::SQLWarning;
using ::com::sun::star::uno::RuntimeException;
typedef css::uno::Reference<css::container::XNameAccess> my_XNameAccessRef;
typedef ::cppu::WeakComponentImplHelper3<css::sdbc::XConnection, css::sdbc::XWarningsSupplier,
css::lang::XServiceInfo>
......@@ -161,9 +160,10 @@ public: