[Libreoffice-commits] core.git: sw/source
Tor Lillqvist
tml at collabora.com
Wed Apr 30 02:51:33 PDT 2014
sw/source/core/uibase/uiview/view.cxx | 6 +++---
sw/source/core/uibase/uiview/view0.cxx | 10 ++++++++--
sw/source/core/uibase/uiview/view1.cxx | 2 +-
sw/source/core/uibase/uiview/viewport.cxx | 4 ++--
4 files changed, 14 insertions(+), 8 deletions(-)
New commits:
commit 24be5b2728ba7a5c0ebcc53a37bc46b05e889133
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Apr 30 12:50:01 2014 +0300
WaE: suggest parentheses around assignment used as truth value
While at it, change the lovely bDocSzUpdated global variable into a bool.
Change-Id: I6e60e1516e9345076ea08b5aa7029d10d324cb28
diff --git a/sw/source/core/uibase/uiview/view.cxx b/sw/source/core/uibase/uiview/view.cxx
index a343c71..705514f 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 e18be9a..8c1c950 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 de2db60..0a56ee6 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 574c402..7c119bf 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;
}
More information about the Libreoffice-commits
mailing list