From 4b0023accc8e8c79876e3b377fda19150807e4ec Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 6 Jun 2008 14:05:22 +0200
Subject: [PATCH] Fix sfx2 compile warnings.

---
 sfx2/source/appl/appopen.cxx         |    3 ++-
 sfx2/source/bastyp/fltfnc.cxx        |    2 +-
 sfx2/source/control/bindings.cxx     |    3 ++-
 sfx2/source/control/dispatch.cxx     |    6 ++++--
 sfx2/source/control/unoctitm.cxx     |    8 +++++---
 sfx2/source/dialog/dockwin.cxx       |    8 +++++---
 sfx2/source/dialog/splitwin.cxx      |    2 +-
 sfx2/source/dialog/templdlg.cxx      |   19 +++++++++++++------
 sfx2/source/doc/docfile.cxx          |    9 +++++----
 sfx2/source/doc/docfilt.cxx          |    6 ++++--
 sfx2/source/doc/doctempl.cxx         |    8 +++++---
 sfx2/source/doc/doctemplates.cxx     |    2 +-
 sfx2/source/doc/docvor.cxx           |   12 ++++++------
 sfx2/source/doc/guisaveas.cxx        |    2 ++
 sfx2/source/doc/objcont.cxx          |    2 +-
 sfx2/source/doc/objembed.cxx         |    2 ++
 sfx2/source/doc/objmisc.cxx          |    2 +-
 sfx2/source/doc/objserv.cxx          |    6 +++---
 sfx2/source/doc/objstor.cxx          |   25 ++++++++++++++-----------
 sfx2/source/doc/objuno.cxx           |    4 ++--
 sfx2/source/notify/eventsupplier.cxx |    3 ++-
 sfx2/source/view/ipclient.cxx        |    5 +++--
 sfx2/source/view/viewsh.cxx          |    4 +++-
 23 files changed, 87 insertions(+), 56 deletions(-)

diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 7d17c15..fccecdf 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -211,7 +211,8 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
                  SfxViewFrame::GetFirst( xDoc, TYPE(SfxTopViewFrame) );
              pFrame && !pFrame->IsVisible_Impl();
              pFrame = (SfxTopViewFrame*)
-                 SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) );
+                 SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) )
+            ;
 		if ( pFrame )
 		{
 		    SfxViewFrame *pCur = SfxViewFrame::Current();
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index c2876fa..2979d3b 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -626,7 +626,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
 */
     *ppFilter = pFilter;
 
-    if ( bHidden || bAPI && nErr == ERRCODE_SFX_CONSULTUSER )
+    if ( bHidden || (bAPI && nErr == ERRCODE_SFX_CONSULTUSER) )
 		nErr = pFilter ? ERRCODE_NONE : ERRCODE_ABORT;
     return nErr;
 }
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index c8414da..1bebc4f 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -2080,7 +2080,8 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
 
 	// modifying the SfxObjectInterface-stack without SfxBindings => nothing to do
     SfxViewFrame* pFrame = pDispatcher->GetFrame();
-    if ( pFrame && pFrame->GetObjectShell()->IsInModalMode() || pSfxApp->IsDowning() || !pImp->pCaches->Count() )
+    if ( (pFrame && pFrame->GetObjectShell()->IsInModalMode())
+         || pSfxApp->IsDowning() || !pImp->pCaches->Count() )
 	{
 		DBG_PROFSTOP(SfxBindingsNextJob_Impl0);
 		return sal_True;
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index fc231cc..794f99b 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -884,7 +884,8 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
                 for (sal_uInt16 n=0; n<pImp->aChildWins.Count();)
                 {
                     SfxChildWindow *pWin = pWorkWin->GetChildWindow_Impl( (sal_uInt16) ( pImp->aChildWins[n] & 0xFFFF ) );
-                    if (!pWin || pWin && pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT)
+                    if (!pWin ||
+                        (pWin && pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT))
                         pImp->aChildWins.Remove(n);
                     else
                         n++;
@@ -1824,7 +1825,8 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
 
     // bQuiet : own shells aren't considered for UI and SlotServer
     // bNoUI: own Shells aren't considered fors UI
-    if ( pImp->bQuiet || pImp->bNoUI || pImp->pFrame && pImp->pFrame->GetObjectShell()->IsPreview() )
+    if ( pImp->bQuiet || pImp->bNoUI
+         || (pImp->pFrame && pImp->pFrame->GetObjectShell()->IsPreview() ))
 		return nHelpId;
 
 	sal_uInt32 nStatBarId=0;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index ff135be..eb7c023 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -671,9 +671,11 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener ) throw( ::com::sun::star::uno::RuntimeException )
 {
     ::vos::OGuard aGuard( Application::GetSolarMutex() );
-    if ( pDispatch &&
-        ( aURL.Protocol.equalsAsciiL( ".uno:", 5 ) && aURL.Path == aDispatchURL.Path ||
-          aURL.Protocol.equalsAsciiL( "slot:", 5 ) && aURL.Path.toInt32() == GetId() ) )
+    if ( pDispatch
+         && ( (aURL.Protocol.equalsAsciiL( ".uno:", 5 )
+               && aURL.Path == aDispatchURL.Path)
+              || (aURL.Protocol.equalsAsciiL( "slot:", 5 )
+                  && aURL.Path.toInt32() == GetId() ) ))
 	{
         /*
         if ( !IsBound() && pBindings )
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index e1e71b4..36ac205 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -157,7 +157,7 @@ BOOL SfxDockingWindow::PrepareToggleFloatingMode()
 	if (!pImp->bConstructed)
 		return TRUE;
 
-	if ( Application::IsInModalMode() && IsFloatingMode() || !pMgr )
+	if ( (Application::IsInModalMode() && IsFloatingMode()) || !pMgr )
 		return FALSE;
 
     if ( pImp->bDockingPrevented )
@@ -719,8 +719,10 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
 	if ( GetAlignment() != SFX_ALIGN_NOALIGNMENT )
 	{
         // check if SfxWorkWindow is able to allow docking at its border
-		if ( !pWorkWin->IsDockingAllowed() || !pWorkWin->IsInternalDockingAllowed() || ( GetFloatStyle() & WB_STANDALONE )
-			&& Application::IsInModalMode() )
+		if ( !pWorkWin->IsDockingAllowed()
+             || !pWorkWin->IsInternalDockingAllowed()
+             || (( GetFloatStyle() & WB_STANDALONE )
+                 && Application::IsInModalMode()) )
 			SetAlignment( SFX_ALIGN_NOALIGNMENT );
 	}
 
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 74d21e0..bf5bb37 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -637,7 +637,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
 			USHORT nL=0, nP=0;
 			GetWindowPos( pD->pWin, nL, nP );
 
-			if ( nL == nLine && nP == nPos || nL > nLine )
+			if ( (nL == nLine && nP == nPos) || nL > nLine )
 			{
 				DBG_ASSERT( nL == nLine || bNewLine || nPos > 0, "Falsche Parameter!" );
 				if ( nL == nLine && nPos == 0 && !bNewLine )
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index de32503..4775686 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -554,7 +554,8 @@ BOOL StyleTreeListBox_Impl::NotifyMoving(SvLBoxEntry*  pTarget,
 	for(SvLBoxEntry *pTmpEntry=FirstChild(pTarget);
 		pTmpEntry && COMPARE_LESS==pCollator->compareString(
 			GetEntryText(pTmpEntry),GetEntryText(pEntry));
-		pTmpEntry=NextSibling(pTmpEntry),lPos++);
+		pTmpEntry=NextSibling(pTmpEntry),lPos++)
+        ;
 
 	return bRet? (BOOL)2: FALSE;
 }
@@ -695,7 +696,8 @@ StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr)
 					for ( ii = 0;
 						 ii < pCmp->Count() && COMPARE_LESS ==
 						 pCollator->compareString( (*pCmp->pChilds)[ii]->aName,
-										pEntry->aName);++ii);
+										pEntry->aName);++ii)
+                        ;
 					pCmp->Put(pEntry,ii);
 					break;
 				}
@@ -1396,10 +1398,12 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem)
 		SfxControllerItem *pCItem=pBoundItems[n];
 		BOOL bChecked = pItem && pItem->GetValue();
 		if( pCItem->IsBound() == bChecked )
+        {
 			if( !bChecked )
 				pCItem->ReBind();
 			else
 				pCItem->UnBind();
+        }
 	}
 	pBindings->LeaveRegistrations();
 }
@@ -1573,9 +1577,11 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
 			{
 				SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
 				SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
-				if( bUpdate && (
-					!IsCheckedItem(SID_STYLE_WATERCAN) || pDocShell
-					&& pDocShell->GetStyleSheetPool() != pStyleSheetPool) )
+				if( bUpdate
+                    && ( !IsCheckedItem(SID_STYLE_WATERCAN)
+                         || pDocShell
+                         && (pDocShell->GetStyleSheetPool()
+                             != pStyleSheetPool)) )
 				{
 					bUpdate = FALSE;
 					Update_Impl();
@@ -2871,7 +2877,8 @@ void SfxTemplateCatalog_Impl::CheckItem(USHORT nMesId, BOOL /*bCheck*/)
 	if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR )
 		return;
 	USHORT i;
-	for ( i = 0; i < aFamIds.Count() && aFamIds[i] != nMesId; i++ );
+	for ( i = 0; i < aFamIds.Count() && aFamIds[i] != nMesId; i++ )
+        ;
 	aFamList.SelectEntryPos(i);
 }
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 446ae4a..802dc9c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -484,7 +484,8 @@ Reference < XContent > SfxMedium::GetContent() const
     {
         SvtSaveOptions aOpt;
         sal_Bool bIsRemote = IsRemote();
-        if( bIsRemote && !aOpt.IsSaveRelINet() || !bRemote && !aOpt.IsSaveRelFSys() )
+        if( (bIsRemote && !aOpt.IsSaveRelINet())
+            || (!bRemote && !aOpt.IsSaveRelFSys()) )
             return ::rtl::OUString();
     }
 
@@ -1094,7 +1095,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading )
         {
             // the error should be set in case it is storing process
             // or the document has been opened for editing explicitly
-            if ( !bLoading || pReadOnlyItem && !pReadOnlyItem->GetValue() )
+            if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) )
                 SetError( ERRCODE_IO_ACCESSDENIED );
             else 
                 GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
@@ -1762,8 +1763,8 @@ sal_Bool SfxMedium::TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet&
             		aInsertArg.Data = xInStream;
                		SFX_ITEMSET_ARG( &aTargetSet, pRename, SfxBoolItem, SID_RENAME, sal_False );
                		SFX_ITEMSET_ARG( &aTargetSet, pOverWrite, SfxBoolItem, SID_OVERWRITE, sal_False );
-               		if ( pOverWrite && !pOverWrite->GetValue() // argument says: never overwrite
-               		  || pRename && pRename->GetValue() ) // argument says: rename file
+               		if ( (pOverWrite && !pOverWrite->GetValue()) // argument says: never overwrite
+                         || (pRename && pRename->GetValue()) ) // argument says: rename file
             			aInsertArg.ReplaceExisting = sal_False;
                		else
             			aInsertArg.ReplaceExisting = sal_True; // default is overwrite existing files
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index 6ebf130..18a9190 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -119,8 +119,10 @@ String SfxFilter::GetDefaultExtension() const
 String SfxFilter::GetSuffixes() const
 {
 	String aRet = GetWildcard()();
-	while( aRet.SearchAndReplaceAscii( "*.", String() ) != STRING_NOTFOUND );
-	while( aRet.SearchAndReplace( ';', ',' ) != STRING_NOTFOUND );
+	while( aRet.SearchAndReplaceAscii( "*.", String() ) != STRING_NOTFOUND )
+        ;
+	while( aRet.SearchAndReplace( ';', ',' ) != STRING_NOTFOUND )
+        ;
 	return aRet;
 }
 
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index bed1a0e..78dc4ed 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -1915,9 +1915,9 @@ SfxObjectShellRef DocTempl_EntryData_Impl::CreateObjectShell()
             const SfxFilter* pFilter = NULL;
             pMed->UseInteractionHandler(TRUE);
             if( pSfxApp->GetFilterMatcher().GuessFilter(
-                *pMed, &pFilter, SFX_FILTER_TEMPLATE, 0 ) ||
-                pFilter && !pFilter->IsOwnFormat() ||
-                pFilter && !pFilter->UsesStorage() )
+                    *pMed, &pFilter, SFX_FILTER_TEMPLATE, 0 )
+                || (pFilter && !pFilter->IsOwnFormat())
+                || (pFilter && !pFilter->UsesStorage()) )
             {
                 SfxErrorContext aEc( ERRCTX_SFX_LOADTEMPLATE,
                                      aTargetURL );
@@ -1966,6 +1966,7 @@ BOOL DocTempl_EntryData_Impl::DeleteObjectShell()
             bRet = sal_False;
 
             if ( mbIsOwner )
+            {
                 if( mbDidConvert )
                 {
                     bRet=mxObjShell->PreDoSaveAs_Impl(
@@ -1991,6 +1992,7 @@ BOOL DocTempl_EntryData_Impl::DeleteObjectShell()
 						}
 					}
                 }
+            }
         }
 
         if( bRet )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index c04ff20..3bfd765 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1774,7 +1774,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
 			aValue >>= aTemplateToRemoveTargetURL;
 
 		if ( !aGroupTargetURL.getLength() || !maTemplateDirs.getLength()
-		  || aTemplateToRemoveTargetURL.getLength() && !::utl::UCBContentHelper::IsSubPath( maTemplateDirs[ maTemplateDirs.getLength() - 1 ], aTemplateToRemoveTargetURL ) )
+             || ((aTemplateToRemoveTargetURL.getLength() && !::utl::UCBContentHelper::IsSubPath( maTemplateDirs[ maTemplateDirs.getLength() - 1 ], aTemplateToRemoveTargetURL ) ) ) )
         	return sal_False; // it is not allowed to remove the template
 	}
 
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 17e7501..0a0103c 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -1735,12 +1735,12 @@ BOOL SfxOrganizeDlg_Impl::DontDelete_Impl( SvLBoxEntry* pEntry )
 	if(SfxOrganizeListBox_Impl::VIEW_FILES ==
 	   pFocusBox->GetViewType())
 		nDepth++;
-	if( nDepth > 2 && !pEntry->GetUserData() ||
-	   //Delete ueber GetContent verboten
-	   nDepth==2 || //Vorlage / Konfigurtionsrubrik nicht loeshcen
-	   (nDepth==1 && SfxOrganizeListBox_Impl::VIEW_FILES ==
-		pFocusBox->GetViewType()) || //Files nicht loeschen
-	   (0 == nDepth && pFocusBox->GetLevelCount_Impl(0) < 2))
+	if( (nDepth > 2 && !pEntry->GetUserData())
+        //Delete ueber GetContent verboten
+        || nDepth == 2 //Vorlage / Konfigurtionsrubrik nicht loeshcen
+        || (nDepth == 1 && SfxOrganizeListBox_Impl::VIEW_FILES
+            == pFocusBox->GetViewType()) //Files nicht loeschen
+        || (0 == nDepth && pFocusBox->GetLevelCount_Impl(0) < 2))
 		//Mindestens eine Vorlage behalten
 	{
 		return TRUE;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 63dfa43..b0f6ecf 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1300,10 +1300,12 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
 		{
 			sal_Bool bUseSystemDialog = sal_True;
 			if ( aDlgIter->second >>= bUseSystemDialog )
+            {
 				if ( bUseSystemDialog )
 					nDialog = SFX2_IMPL_DIALOG_SYSTEM;
 				else
 					nDialog = SFX2_IMPL_DIALOG_OOO;
+            }
 		}
 
 		::comphelper::SequenceAsHashMap::const_iterator aPathIter =
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index db4dbbb..aaeac3f 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1233,7 +1233,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl(  )
     ::rtl::OUString aTemplURL( xDocProps->getTemplateURL() );
     String aFoundName;
 
-    if ( aTemplName.getLength() || aTemplURL.getLength() && !IsReadOnly() )
+    if ( aTemplName.getLength() || (aTemplURL.getLength() && !IsReadOnly()) )
 	{
         // try to locate template, first using filename
         // this must be done because writer global document uses this "great" idea to manage the templates of all parts
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index ab6bb5c..6e4c242 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -277,10 +277,12 @@ void SfxObjectShell::DoDraw_Impl( OutputDevice* pDev,
 
 	GDIMetaFile * pMtf = pDev->GetConnectMetaFile();
 	if( pMtf )
+    {
 		if( pMtf->IsRecord() && pDev->GetOutDevType() != OUTDEV_PRINTER )
 			pMtf->Stop();
 		else
 			pMtf = NULL;
+    }
 // #ifndef UNX
 	if( pDev->IsClipRegion() && pDev->GetOutDevType() != OUTDEV_PRINTER )
 // #endif
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index f50cc74..5b47d4a 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -2124,7 +2124,7 @@ String SfxObjectShell::UpdateTitle( SfxMedium* pMed, USHORT nDocViewNumber )
         	aTitle += String( SfxResId(STR_REPAIREDDOCUMENT) );
 	}
 
-	if ( IsReadOnlyUI() || pMed && pMed->IsReadOnly() )
+	if ( IsReadOnlyUI() || (pMed && pMed->IsReadOnly()) )
         aTitle += String( SfxResId(STR_READONLY) );
     else if ( IsDocShared() )
         aTitle += String( SfxResId(STR_SHARED) );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a2ccc2c..2714315 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1399,15 +1399,15 @@ void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
     bool bNoSig = false;
 
     if ( IsModified() || !GetMedium() || !GetMedium()->GetName().Len() 
-      || !aODFVersion.equals( ODFVER_012_TEXT ) && !bHasSign )
+         || (!aODFVersion.equals( ODFVER_012_TEXT ) && !bHasSign) )
     {
         // the document might need saving ( new, modified or in ODF1.1 format without signature )
 
         if ( nVersion == SvtSaveOptions::ODFVER_012 )
         {
 
-            if ( bHasSign && QueryBox( NULL, SfxResId( MSG_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN ) ).Execute() == RET_YES
-              || !bHasSign && QueryBox( NULL, SfxResId( RID_XMLSEC_QUERY_SAVEBEFORESIGN ) ).Execute() == RET_YES )
+            if ( (bHasSign && QueryBox( NULL, SfxResId( MSG_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN ) ).Execute() == RET_YES)
+                 || (!bHasSign && QueryBox( NULL, SfxResId( RID_XMLSEC_QUERY_SAVEBEFORESIGN ) ).Execute() == RET_YES) )
             {
                 USHORT nId = SID_SAVEDOC;
                 if ( !GetMedium() || !GetMedium()->GetName().Len() )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index b126fcc..3369522 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -829,9 +829,9 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
 					String aAppName(aUserData, pos+strlen(PREPROCESS_CONST), end-(pos+strlen(PREPROCESS_CONST)));
 
 					// setup status bar
-					SfxItemSet *pSet = pMed->GetItemSet();
+					SfxItemSet *newpSet = pMed->GetItemSet();
 					const SfxUnoAnyItem *pItem=NULL;
-					SfxItemState ret=pSet->GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, TRUE, (const SfxPoolItem**)&pItem);
+					SfxItemState ret=newpSet->GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, TRUE, (const SfxPoolItem**)&pItem);
 					uno::Reference< ::com::sun::star::task::XStatusIndicator > xStatusIndicator;
 					if (ret==SFX_ITEM_SET && pItem!=NULL)
 					{
@@ -1355,8 +1355,10 @@ sal_Bool SfxObjectShell::SaveTo_Impl
             // preserve only if the same filter has been used
             bTryToPreservScriptSignature = pMedium->GetFilter() && pFilter && pMedium->GetFilter()->GetFilterName() == pFilter->GetFilterName();
 
-            bNoPreserveForOasis = ( aODFVersion.equals( ODFVER_012_TEXT ) && nVersion == SvtSaveOptions::ODFVER_011
-                                      || !aODFVersion.getLength() && nVersion == SvtSaveOptions::ODFVER_012 );
+            bNoPreserveForOasis = ( (aODFVersion.equals( ODFVER_012_TEXT )
+                                     && nVersion == SvtSaveOptions::ODFVER_011)
+                                    || (!aODFVersion.getLength()
+                                        && nVersion == SvtSaveOptions::ODFVER_012 ));
         }
 	}
 
@@ -1365,8 +1367,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
     if( pMedSet )
     {
         SFX_ITEMSET_ARG( pMedSet, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
-        bCopyTo =   GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
-                    pSaveToItem && pSaveToItem->GetValue();
+        bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
+            || (pSaveToItem && pSaveToItem->GetValue());
     }
 
     // use UCB for case sensitive/insensitive file name comparison
@@ -1821,9 +1823,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
 			String aAppName(aUserData, pos+strlen(POSTPROCESS_CONST), end-(pos+strlen(POSTPROCESS_CONST)));
 
 			// setup status bar
-			SfxItemSet *pSet = rMedium.GetItemSet();
+			SfxItemSet *newpSet = rMedium.GetItemSet();
 			const SfxUnoAnyItem *pItem=NULL;
-			SfxItemState ret=pSet->GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, TRUE, (const SfxPoolItem**)&pItem);
+			SfxItemState ret=newpSet->GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, TRUE, (const SfxPoolItem**)&pItem);
 			uno::Reference< ::com::sun::star::task::XStatusIndicator > xStatusIndicator;
 			if (ret==SFX_ITEM_SET && pItem!=NULL)
 			{
@@ -2813,8 +2815,8 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
 
     const SfxFilter* pFilter = GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName );
     if ( !pFilter
-		|| !pFilter->CanExport()
-		|| !bSaveTo && !pFilter->CanImport() )
+         || !pFilter->CanExport()
+         || (!bSaveTo && !pFilter->CanImport()) )
     {
         SetError( ERRCODE_IO_INVALIDPARAMETER );
         return sal_False;
@@ -2978,7 +2980,8 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
 
     // check if a "SaveTo" is wanted, no "SaveAs"
     SFX_ITEMSET_ARG( pParams, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
-    sal_Bool bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || pSaveToItem && pSaveToItem->GetValue();
+    sal_Bool bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
+        || (pSaveToItem && pSaveToItem->GetValue());
 
     // distinguish between "Save" and "SaveAs"
     pImp->bIsSaving = sal_False;
diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx
index e4641cb..ee097a9 100644
--- a/sfx2/source/doc/objuno.cxx
+++ b/sfx2/source/doc/objuno.cxx
@@ -136,8 +136,8 @@ inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
 		return aDaysInMonth[nMonth-1];
 	else
 	{
-		if ( ((nYear % 4) == 0) && ((nYear % 100) != 0) ||
-			 ((nYear % 400) == 0) )
+		if ( (((nYear % 4) == 0) && ((nYear % 100) != 0))
+             || ((nYear % 400) == 0) )
 			return aDaysInMonth[nMonth-1] + 1;
 		else
 			return aDaysInMonth[nMonth-1];
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 414bc94..bab4343 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -528,7 +528,8 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
 
 		if ( aLibrary.compareToAscii("document") != 0 )
 		{
-			if ( !aLibrary.getLength() || pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() ) )
+			if ( !aLibrary.getLength()
+                 || ( pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() ) ) )
 				aLibrary = String::CreateFromAscii("document");
 			else
 				aLibrary = String::CreateFromAscii("application");
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index f67ec29..e2c8838 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -868,8 +868,9 @@ sal_Bool SfxInPlaceClient::IsObjectUIActive() const
 sal_Bool SfxInPlaceClient::IsObjectInPlaceActive() const
 {
 	try {
-        return ( m_pImp->m_xObject.is() && ( m_pImp->m_xObject->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE ) ||
-                 m_pImp->m_xObject.is() && ( m_pImp->m_xObject->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) );
+        return ( (m_pImp->m_xObject.is()
+                  && ( m_pImp->m_xObject->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE ))
+                 || (m_pImp->m_xObject.is() && ( m_pImp->m_xObject->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) ) );
 	}
 	catch( uno::Exception& )
 	{}
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index ee1b691..687585e 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1703,7 +1703,9 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan
        	// object in client is currently not active
        	// check if the object wants to be activated always or when it becomes at least partially visible
        	// TODO/LATER: maybe we should use the scaled area instead of the ObjArea?!
-       	if ( bAlwaysActive || bActiveWhenVisible && rVisArea.IsOver( pIPClient->GetObjArea() ) )
+       	if ( bAlwaysActive
+             || ( bActiveWhenVisible
+                  && rVisArea.IsOver( pIPClient->GetObjArea() ) ) )
 		{
 			try
 			{
-- 
1.5.6.3.317.g5d44c9.dirty


