From 677e0660fa3c52e047d82e48aa4286db679dc7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Fri, 10 Jan 2014 18:31:26 +0100 Subject: [PATCH 1/2] Remove unused arguments REVIEW: 114958 --- core/fileprinter.cpp | 2 +- core/script/kjs_data.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/fileprinter.cpp b/core/fileprinter.cpp index 4c7cf991d..55977a1ba 100644 --- a/core/fileprinter.cpp +++ b/core/fileprinter.cpp @@ -438,7 +438,7 @@ QStringList FilePrinter::jobname( QPrinter &printer, const QString &version ) return QStringList(); } -QStringList FilePrinter::deleteFile( QPrinter &printer, FileDeletePolicy fileDeletePolicy, const QString &version ) +QStringList FilePrinter::deleteFile( QPrinter &, FileDeletePolicy fileDeletePolicy, const QString &version ) { if ( fileDeletePolicy == FilePrinter::SystemDeletesFiles && version.startsWith( "lpr" ) ) { return QStringList("-r"); diff --git a/core/script/kjs_data.cpp b/core/script/kjs_data.cpp index 5c76d94e6..30544dcbb 100644 --- a/core/script/kjs_data.cpp +++ b/core/script/kjs_data.cpp @@ -35,7 +35,7 @@ static KJSObject dataGetDescription( KJSContext *, void *object ) return KJSString( file->description() ); } -static KJSObject dataGetMIMEType( KJSContext *, void *object ) +static KJSObject dataGetMIMEType( KJSContext *, void * ) { return KJSString( "" ); } @@ -54,7 +54,7 @@ static KJSObject dataGetName( KJSContext *, void *object ) return KJSString( file->name() ); } -static KJSObject dataGetPath( KJSContext *, void *object ) +static KJSObject dataGetPath( KJSContext *, void * ) { return KJSString( "" ); } From 2bd0ec5fda5d7321fff0239f382f69c90adff0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Fri, 10 Jan 2014 18:28:07 +0100 Subject: [PATCH 2/2] The doesConsumeX method was defined but never used Having functions which are defined but not used serves no gain. This patch therefore removes the extra method and updates the comment reference in the second one to make it standalone. REVIEW: 114959 --- core/textpage.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/core/textpage.cpp b/core/textpage.cpp index c1bd1f2be..a95f7c6b2 100644 --- a/core/textpage.cpp +++ b/core/textpage.cpp @@ -63,38 +63,11 @@ static bool CaseSensitiveCmpFn( const QStringRef & from, const QStringRef & to ) } /** - * If the horizontal arm of one rectangle fully contains the other (example below) + * If the vertical arm of one rectangle fully contains the other (example below) * -------- ---- ----- first * ---- -------- ----- second * or we can make it overlap of spaces by threshold% */ -static bool doesConsumeX(const QRect& first, const QRect& second, int threshold) -{ - // if one consumes another fully - if(first.left() <= second.left() && first.right() >= second.right()) - return true; - - if(first.left() >= second.left() && first.right() <= second.right()) - return true; - - // or if there is overlap of space by more than threshold% - // there is overlap - if(second.right() >= first.left() && first.right() >= second.left()) - { - const int overlap = (second.right() >= first.right()) ? first.right() - second.left() - : second.right() - first.left(); - // we will divide by the smaller rectangle to calculate the overlap - const int percentage = (first.width() < second.width()) ? overlap * 100 / (first.right() - first.left()) - : overlap * 100 / (second.right() - second.left()); - if(percentage >= threshold) return true; - } - - return false; -} - -/** - * Same concept of doesConsumeX but in this case we calculate on y axis - */ static bool doesConsumeY(const QRect& first, const QRect& second, int threshold) { // if one consumes another fully