Replace qSwap with std::swap

Fixes obsolete function 'qSwap' called. It is recommended to use 'std::swap'
instead. (CWE-477)
remotes/origin/work/svuorela/remove-write-only-variable-1
Willyanto Willyanto 3 years ago committed by Albert Astals Cid
parent da5afd0854
commit 98876cf588
  1. 2
      core/document.cpp
  2. 2
      core/generator.cpp
  3. 4
      core/page.cpp
  4. 2
      core/tilesmanager.cpp
  5. 2
      generators/spectre/rendererthread.cpp

@ -5230,7 +5230,7 @@ QPrinter::Orientation Document::orientation() const
width = currentPage->width(); width = currentPage->width();
height = currentPage->height(); height = currentPage->height();
if (currentPage->orientation() == Okular::Rotation90 || currentPage->orientation() == Okular::Rotation270) { if (currentPage->orientation() == Okular::Rotation90 || currentPage->orientation() == Okular::Rotation270) {
qSwap(width, height); std::swap(width, height);
} }
if (width > height) { if (width > height) {
landscape++; landscape++;

@ -676,7 +676,7 @@ PixmapRequestPrivate *PixmapRequestPrivate::get(const PixmapRequest *req)
void PixmapRequestPrivate::swap() void PixmapRequestPrivate::swap()
{ {
qSwap(mWidth, mHeight); std::swap(mWidth, mHeight);
} }
class Okular::ExportFormatPrivate : public QSharedData class Okular::ExportFormatPrivate : public QSharedData

@ -391,7 +391,7 @@ void PagePrivate::rotateAt(Rotation orientation)
deleteTextSelections(); deleteTextSelections();
if (((int)m_orientation + (int)m_rotation) % 2 != ((int)m_orientation + (int)orientation) % 2) { if (((int)m_orientation + (int)m_rotation) % 2 != ((int)m_orientation + (int)orientation) % 2) {
qSwap(m_width, m_height); std::swap(m_width, m_height);
} }
Rotation oldRotation = m_rotation; Rotation oldRotation = m_rotation;
@ -451,7 +451,7 @@ void PagePrivate::changeSize(const PageSize &size)
m_width = size.width(); m_width = size.width();
m_height = size.height(); m_height = size.height();
if (m_rotation % 2) { if (m_rotation % 2) {
qSwap(m_width, m_height); std::swap(m_width, m_height);
} }
} }

@ -201,7 +201,7 @@ void TilesManager::setPixmap(const QPixmap *pixmap, const NormalizedRect &rect,
int w = width(); int w = width();
int h = height(); int h = height();
if (d->rotation % 2) { if (d->rotation % 2) {
qSwap(w, h); std::swap(w, h);
pixmapSize.transpose(); pixmapSize.transpose();
} }

@ -64,7 +64,7 @@ void GSRendererThread::run()
int wantedHeight = req.request->height(); int wantedHeight = req.request->height();
if (req.orientation % 2) { if (req.orientation % 2) {
qSwap(wantedWidth, wantedHeight); std::swap(wantedWidth, wantedHeight);
} }
spectre_page_render(req.spectrePage, m_renderContext, &data, &row_length); spectre_page_render(req.spectrePage, m_renderContext, &data, &row_length);

Loading…
Cancel
Save