Andre Poenitz wrote:
On Tue, Jun 23, 2009 at 10:10:00AM +0200, sa...@lyx.org wrote:
Author: sanda
Date: Tue Jun 23 10:09:59 2009
New Revision: 30238
URL: http://www.lyx.org/trac/changeset/30238
Log:
Backport typo & shadowing spotted by Abdel
Modified:
lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp
Modified: lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp Tue Jun
23 03:25:12 2009 (r30237)
+++ lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp Tue Jun
23 10:09:59 2009 (r30238)
@@ -390,13 +390,13 @@
setLayoutDirection(qApp->layoutDirection());
// Allow the toc and view-source dock widget to be restored if needed.
- Dialog *d;
- if ((d = findOrBuild("toc", true)));
+ Dialog * dialog;
+ if ((dialog = findOrBuild("toc", true)))
// see bug 5082. At least setup title and enabled state.
// Visibility will be adjusted by restoreState below.
Assignment within an if condition is a rather uncommon idiom in LyX
code, I would expect
Dialog * dialog = findOrBuild("toc", true);
if (dialog)
...
more in line with the rest of the code.
It's even less line noise in "critical" part...
I'd agree. I find that sort of assignment statement confusing when
reading the code and would be happier if it were pulled apart.
rh
Andre'