summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-30 12:50:01 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-30 12:50:41 +0300
commit24be5b2728ba7a5c0ebcc53a37bc46b05e889133 (patch)
tree5661eb6cc53a2d35717b269359ccfe4cc8c3ab57 /sw
parent6f945d6dc7480465ba9fce93351b1d3cc6b665e3 (diff)
WaE: suggest parentheses around assignment used as truth value
While at it, change the lovely bDocSzUpdated global variable into a bool. Change-Id: I6e60e1516e9345076ea08b5aa7029d10d324cb28
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/uibase/uiview/view.cxx6
-rw-r--r--sw/source/core/uibase/uiview/view0.cxx10
-rw-r--r--sw/source/core/uibase/uiview/view1.cxx2
-rw-r--r--sw/source/core/uibase/uiview/viewport.cxx4
4 files changed, 14 insertions, 8 deletions
diff --git a/sw/source/core/uibase/uiview/view.cxx b/sw/source/core/uibase/uiview/view.cxx
index a343c712db9c..705514fcb967 100644
--- a/sw/source/core/uibase/uiview/view.cxx
+++ b/sw/source/core/uibase/uiview/view.cxx
@@ -117,9 +117,9 @@ extern bool bNoInterrupt; // in mainwn.cxx
#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT| \
SFX_VIEW_HAS_PRINTOPTIONS)
-// Statics
+// Statics. OMG.
-int bDocSzUpdated = 1;
+bool bDocSzUpdated = true;
SvxSearchItem* SwView::m_pSrchItem = 0;
@@ -736,7 +736,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_bVerbsActive = m_bDrawRotate = m_bInOuterResizePixel = m_bInInnerResizePixel =
m_bPasteState = m_bPasteSpecialState = m_bMakeSelectionVisible = false;
- m_bShowAtResize = m_bDrawSelMode = bDocSzUpdated = sal_True;
+ m_bShowAtResize = m_bDrawSelMode = bDocSzUpdated = true;
_CreateScrollbar( true );
_CreateScrollbar( false );
diff --git a/sw/source/core/uibase/uiview/view0.cxx b/sw/source/core/uibase/uiview/view0.cxx
index e18be9af5e2b..8c1c9504b631 100644
--- a/sw/source/core/uibase/uiview/view0.cxx
+++ b/sw/source/core/uibase/uiview/view0.cxx
@@ -506,7 +506,10 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
case SID_AUTOSPELL_CHECK:
if( STATE_TOGGLE == eState )
- bFlag = bSet = !pOpt->IsOnlineSpell();
+ {
+ bFlag = !pOpt->IsOnlineSpell();
+ bSet = bFlag;
+ }
pOpt->SetOnlineSpell(bSet);
{
@@ -538,7 +541,10 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
case FN_SHADOWCURSOR:
if( STATE_TOGGLE == eState )
- bFlag = bSet = !pOpt->IsShadowCursor();
+ {
+ bFlag = !pOpt->IsShadowCursor();
+ bSet = bFlag;
+ }
pOpt->SetShadowCursor(bSet);
break;
diff --git a/sw/source/core/uibase/uiview/view1.cxx b/sw/source/core/uibase/uiview/view1.cxx
index de2db60fc66c..0a56ee679108 100644
--- a/sw/source/core/uibase/uiview/view1.cxx
+++ b/sw/source/core/uibase/uiview/view1.cxx
@@ -38,7 +38,7 @@
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
-extern int bDocSzUpdated;
+extern bool bDocSzUpdated;
void SwView::Activate(bool bMDIActivate)
{
diff --git a/sw/source/core/uibase/uiview/viewport.cxx b/sw/source/core/uibase/uiview/viewport.cxx
index 574c402d3c8d..7c119bf608c0 100644
--- a/sw/source/core/uibase/uiview/viewport.cxx
+++ b/sw/source/core/uibase/uiview/viewport.cxx
@@ -166,13 +166,13 @@ Point SwView::AlignToPixel(const Point &rPt) const
void SwView::DocSzChgd(const Size &rSz)
{
-extern int bDocSzUpdated;
+extern bool bDocSzUpdated;
m_aDocSz = rSz;
if( !m_pWrtShell || m_aVisArea.IsEmpty() ) // no shell -> no change
{
- bDocSzUpdated = sal_False;
+ bDocSzUpdated = false;
return;
}