From e4de08a0a303d05215e6f5a8f4413fc1e35e3744 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 4 Mar 2017 11:21:52 +0100 Subject: [PATCH 1/3] GIT_SILENT Upgrade KDE Applications version to 16.12.3. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c37b41375..75372202e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) # KDE Application Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "16") set (KDE_APPLICATIONS_VERSION_MINOR "12") -set (KDE_APPLICATIONS_VERSION_MICRO "2") +set (KDE_APPLICATIONS_VERSION_MICRO "3") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") include(ECMInstallIcons) From 7da5adce57abc2055561cde067b92c64700d1e3e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sun, 5 Mar 2017 19:35:16 +0100 Subject: [PATCH 2/3] indent++ --- generators/djvu/kdjvu.cpp | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/generators/djvu/kdjvu.cpp b/generators/djvu/kdjvu.cpp index c2e345ce7..210550729 100644 --- a/generators/djvu/kdjvu.cpp +++ b/generators/djvu/kdjvu.cpp @@ -909,27 +909,27 @@ QImage KDjVu::image( int page, int width, int height, int rotation ) { if ( d->m_cacheEnabled ) { - bool found = false; - QList::Iterator it = d->mImgCache.begin(), itEnd = d->mImgCache.end(); - for ( ; ( it != itEnd ) && !found; ++it ) - { - ImageCacheItem* cur = *it; - if ( ( cur->page == page ) && - ( rotation % 2 == 0 - ? cur->width == width && cur->height == height - : cur->width == height && cur->height == width ) ) - found = true; - } - if ( found ) - { - // taking the element and pushing to the top of the list - --it; - ImageCacheItem* cur2 = *it; - d->mImgCache.erase( it ); - d->mImgCache.push_front( cur2 ); + bool found = false; + QList::Iterator it = d->mImgCache.begin(), itEnd = d->mImgCache.end(); + for ( ; ( it != itEnd ) && !found; ++it ) + { + ImageCacheItem* cur = *it; + if ( ( cur->page == page ) && + ( rotation % 2 == 0 + ? cur->width == width && cur->height == height + : cur->width == height && cur->height == width ) ) + found = true; + } + if ( found ) + { + // taking the element and pushing to the top of the list + --it; + ImageCacheItem* cur2 = *it; + d->mImgCache.erase( it ); + d->mImgCache.push_front( cur2 ); - return cur2->img; - } + return cur2->img; + } } if ( !d->m_pages_cache.at( page ) ) From 0419812ad7b86417bfda3e165957f33419e9fa4f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sun, 5 Mar 2017 19:51:29 +0100 Subject: [PATCH 3/3] djvu: Initialize to white if rendering fails It's what ddjvu does, and also it's not nice to return an uninitialzed image back to the user BUGS: 377202 --- generators/djvu/kdjvu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generators/djvu/kdjvu.cpp b/generators/djvu/kdjvu.cpp index 210550729..36ae46b19 100644 --- a/generators/djvu/kdjvu.cpp +++ b/generators/djvu/kdjvu.cpp @@ -494,6 +494,10 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res, ddjvu_page_get_width( djvupage ); res = ddjvu_page_render( djvupage, DDJVU_RENDER_COLOR, &pagerect, &renderrect, m_format, res_img.bytesPerLine(), (char *)res_img.bits() ); + if (!res) + { + res_img.fill(Qt::white); + } #ifdef KDJVU_DEBUG qDebug() << "rendering result:" << res; #endif