summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-15 19:13:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-17 09:05:38 +0200
commit206b5b2661be37efdff3c6aedb6f248c4636be79 (patch)
treeaf385e5b4725dcfea23988d9113cced8e9ccaf3c /sd/source/ui/view
parenta85d3ba1c0de313b60324b9ecfa488bb99d69d06 (diff)
New loplugin:external
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/drviews7.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx2
-rw-r--r--sd/source/ui/view/sdview3.cxx4
3 files changed, 4 insertions, 4 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index ce0d879415c8..2ed053c37beb 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -111,7 +111,7 @@ using namespace ::com::sun::star::linguistic2;
current clipboard content and the DrawViewShell.
The list is stored in a new instance of SvxClipboardFormatItem.
*/
-::std::unique_ptr<SvxClipboardFormatItem> GetSupportedClipboardFormats (
+static ::std::unique_ptr<SvxClipboardFormatItem> GetSupportedClipboardFormats (
TransferableDataHelper& rDataHelper)
{
::std::unique_ptr<SvxClipboardFormatItem> pResult (
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 6245206d2c0a..fbd489a74c98 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -105,7 +105,7 @@ namespace sd {
// Permanent Functions
-void ImpAddPrintableCharactersToTextEdit(SfxRequest const & rReq, ::sd::View* pView)
+static void ImpAddPrintableCharactersToTextEdit(SfxRequest const & rReq, ::sd::View* pView)
{
// evtl. feed characters to activated textedit
const SfxItemSet* pSet = rReq.GetArgs();
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 1245065e6814..1506542b30c8 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -104,7 +104,7 @@ struct ImpRememberOrigAndClone
SdrObject* pClone;
};
-SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContainer, SdrObject const * pConnObj)
+static SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContainer, SdrObject const * pConnObj)
{
for(ImpRememberOrigAndClone* p : aConnectorContainer)
{
@@ -115,7 +115,7 @@ SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContaine
}
// restrict movement to WorkArea
-void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle& rWorkArea)
+static void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle& rWorkArea)
{
if(!rWorkArea.IsEmpty())
{