Skip to content

Commit

Permalink
CID 248593: Identical code for different branches (IDENTICAL_BRANCHES)
Browse files Browse the repository at this point in the history
identical_branches: The same code is executed regardless of whether
pattern->referenceCoordinates() == KoFlake::ObjectBoundingBox is true,
because the 'then' and 'else' branches are identical. Should one of the
branches be modified, or the entire 'if' statement replaced?
  • Loading branch information
hallarempt committed Sep 26, 2019
1 parent 56bf003 commit 9954ff9
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions libs/flake/svg/SvgStyleWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,17 +508,10 @@ QString SvgStyleWriter::saveSvgVectorPattern(QSharedPointer<KoVectorPatternBackg

const QRectF rect = pattern->referenceRect();

if (pattern->referenceCoordinates() == KoFlake::ObjectBoundingBox) {
context.styleWriter().addAttribute("x", rect.x());
context.styleWriter().addAttribute("y", rect.y());
context.styleWriter().addAttribute("width", rect.width());
context.styleWriter().addAttribute("height", rect.height());
} else {
context.styleWriter().addAttribute("x", rect.x());
context.styleWriter().addAttribute("y", rect.y());
context.styleWriter().addAttribute("width", rect.width());
context.styleWriter().addAttribute("height", rect.height());
}
context.styleWriter().addAttribute("x", rect.x());
context.styleWriter().addAttribute("y", rect.y());
context.styleWriter().addAttribute("width", rect.width());
context.styleWriter().addAttribute("height", rect.height());

SvgUtil::writeTransformAttributeLazy("patternTransform", pattern->patternTransform(), context.styleWriter());

Expand Down

0 comments on commit 9954ff9

Please sign in to comment.