[Libreoffice-commits] core.git: avmedia/source basegfx/source chart2/source comphelper/source compilerplugins/clang cui/source dbaccess/source drawinglayer/source extensions/source filter/source framework/source hwpfilter/source include/osl include/vcl reportdesign/source sal/osl sax/qa sax/source sc/source sd/source sfx2/source starmath/source svtools/source svx/source sw/source toolkit/source unoxml/source vcl/source vcl/unx xmloff/source
Stephan Bergmann
sbergman at redhat.com
Wed Nov 22 18:17:14 UTC 2017
avmedia/source/viewer/mediawindow.cxx | 2 -
basegfx/source/polygon/b2dlinegeometry.cxx | 4 +-
basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 2 -
chart2/source/tools/StatisticsHelper.cxx | 4 +-
comphelper/source/misc/string.cxx | 2 -
compilerplugins/clang/test/unnecessaryparen.cxx | 3 -
compilerplugins/clang/unnecessaryparen.cxx | 13 -------
cui/source/tabpages/numfmt.cxx | 6 +--
dbaccess/source/ui/app/AppSwapWindow.cxx | 2 -
dbaccess/source/ui/misc/UITools.cxx | 2 -
drawinglayer/source/processor3d/defaultprocessor3d.cxx | 2 -
extensions/source/propctrlr/formmetadata.cxx | 8 ++--
filter/source/graphicfilter/eps/eps.cxx | 2 -
filter/source/graphicfilter/icgm/cgm.cxx | 2 -
filter/source/msfilter/escherex.cxx | 8 ++--
filter/source/msfilter/svdfppt.cxx | 2 -
filter/source/svg/svgwriter.cxx | 2 -
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 6 +--
hwpfilter/source/hbox.cxx | 8 ++--
include/osl/file.hxx | 2 -
include/vcl/button.hxx | 4 +-
include/vcl/toolbox.hxx | 2 -
reportdesign/source/ui/inspection/metadata.cxx | 6 +--
sal/osl/unx/socket.cxx | 2 -
sax/qa/cppunit/test_converter.cxx | 6 +--
sax/source/tools/converter.cxx | 10 ++---
sc/source/core/data/table2.cxx | 2 -
sc/source/core/tool/interpr5.cxx | 6 +--
sc/source/filter/excel/excrecds.cxx | 2 -
sc/source/ui/cctrl/checklistmenu.cxx | 2 -
sc/source/ui/miscdlgs/delcodlg.cxx | 2 -
sc/source/ui/miscdlgs/inscodlg.cxx | 2 -
sd/source/core/stlpool.cxx | 2 -
sd/source/filter/eppt/pptx-stylesheet.cxx | 2 -
sd/source/filter/ppt/pptin.cxx | 2 -
sd/source/ui/animations/motionpathtag.cxx | 2 -
sd/source/ui/annotations/annotationtag.cxx | 2 -
sd/source/ui/view/ViewShellBase.cxx | 4 +-
sfx2/source/appl/newhelp.cxx | 2 -
starmath/source/parse.cxx | 2 -
svtools/source/control/ctrlbox.cxx | 4 +-
svx/source/dialog/dlgctrl.cxx | 2 -
svx/source/fmcomp/gridctrl.cxx | 2 -
svx/source/sdr/overlay/overlaymanager.cxx | 2 -
svx/source/sdr/overlay/overlaymanagerbuffered.cxx | 2 -
svx/source/sidebar/area/AreaPropertyPanel.cxx | 8 ++--
svx/source/svdraw/svdattr.cxx | 2 -
svx/source/svdraw/svdedtv.cxx | 2 -
svx/source/svdraw/svdmark.cxx | 8 ++--
svx/source/svdraw/svdmrkv.cxx | 2 -
svx/source/svdraw/svdpage.cxx | 2 -
svx/source/svdraw/svdpoev.cxx | 2 -
svx/source/svdraw/svdviter.cxx | 6 +--
svx/source/tbxctrls/fillctrl.cxx | 6 +--
svx/source/unodraw/unoshape.cxx | 2 -
sw/source/core/bastyp/swregion.cxx | 2 -
sw/source/core/crsr/crstrvl.cxx | 4 +-
sw/source/core/crsr/findattr.cxx | 2 -
sw/source/core/crsr/findtxt.cxx | 4 +-
sw/source/core/crsr/trvlfnfl.cxx | 2 -
sw/source/core/doc/DocumentContentOperationsManager.cxx | 4 +-
sw/source/core/doc/DocumentFieldsManager.cxx | 2 -
sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 4 +-
sw/source/core/doc/DocumentRedlineManager.cxx | 2 -
sw/source/core/doc/doccomp.cxx | 4 +-
sw/source/core/doc/doccorr.cxx | 4 +-
sw/source/core/doc/docdesc.cxx | 8 ++--
sw/source/core/doc/docglos.cxx | 2 -
sw/source/core/docnode/ndsect.cxx | 4 +-
sw/source/core/docnode/ndtbl.cxx | 4 +-
sw/source/core/docnode/nodes.cxx | 2 -
sw/source/core/docnode/section.cxx | 4 +-
sw/source/core/edit/acorrect.cxx | 2 -
sw/source/core/edit/edfld.cxx | 2 -
sw/source/core/edit/edglss.cxx | 4 +-
sw/source/core/edit/editsh.cxx | 2 -
sw/source/core/edit/edundo.cxx | 4 +-
sw/source/core/fields/tblcalc.cxx | 2 -
sw/source/core/frmedt/fecopy.cxx | 2 -
sw/source/core/frmedt/fetab.cxx | 2 -
sw/source/core/layout/atrfrm.cxx | 2 -
sw/source/core/layout/flowfrm.cxx | 2 -
sw/source/core/layout/pagechg.cxx | 6 +--
sw/source/core/layout/pagedesc.cxx | 2 -
sw/source/core/layout/paintfrm.cxx | 14 +++----
sw/source/core/layout/trvlfrm.cxx | 2 -
sw/source/core/table/swtable.cxx | 2 -
sw/source/core/text/itrform2.cxx | 2 -
sw/source/core/text/txtfld.cxx | 26 +++++++-------
sw/source/core/text/wrong.cxx | 2 -
sw/source/core/txtnode/fmtatr2.cxx | 2 -
sw/source/core/txtnode/ndtxt.cxx | 4 +-
sw/source/core/txtnode/thints.cxx | 6 +--
sw/source/core/txtnode/txtedt.cxx | 2 -
sw/source/core/undo/docundo.cxx | 2 -
sw/source/core/undo/undel.cxx | 6 +--
sw/source/core/undo/unsect.cxx | 2 -
sw/source/core/unocore/unobkm.cxx | 4 +-
sw/source/core/unocore/unocrsrhelper.cxx | 8 ++--
sw/source/core/unocore/unofield.cxx | 12 +++---
sw/source/core/unocore/unoflatpara.cxx | 2 -
sw/source/core/unocore/unoframe.cxx | 4 +-
sw/source/core/unocore/unoftn.cxx | 8 ++--
sw/source/core/unocore/unoidx.cxx | 18 ++++-----
sw/source/core/unocore/unoobj.cxx | 14 +++----
sw/source/core/unocore/unoobj2.cxx | 14 +++----
sw/source/core/unocore/unoparagraph.cxx | 4 +-
sw/source/core/unocore/unoredline.cxx | 2 -
sw/source/core/unocore/unorefmk.cxx | 16 ++++----
sw/source/core/unocore/unosect.cxx | 14 +++----
sw/source/core/unocore/unostyle.cxx | 4 +-
sw/source/core/unocore/unotbl.cxx | 8 ++--
sw/source/core/unocore/unotext.cxx | 10 ++---
sw/source/filter/docx/swdocxreader.cxx | 2 -
sw/source/filter/html/htmlsect.cxx | 4 +-
sw/source/filter/ww8/wrtw8sty.cxx | 2 -
sw/source/filter/ww8/wrtww8.cxx | 2 -
sw/source/filter/ww8/ww8atr.cxx | 2 -
sw/source/filter/ww8/ww8glsy.cxx | 2 -
sw/source/filter/ww8/ww8scan.cxx | 4 +-
sw/source/filter/xml/XMLRedlineImportHelper.cxx | 4 +-
sw/source/filter/xml/xmltbli.cxx | 2 -
sw/source/ui/fldui/flddinf.cxx | 2 -
sw/source/ui/fldui/fldvar.cxx | 2 -
sw/source/ui/table/tabledlg.cxx | 2 -
sw/source/uibase/app/applab.cxx | 2 -
sw/source/uibase/app/docst.cxx | 2 -
sw/source/uibase/chrdlg/ccoll.cxx | 2 -
sw/source/uibase/misc/glshell.cxx | 2 -
sw/source/uibase/uiview/viewsrch.cxx | 2 -
sw/source/uibase/uiview/viewtab.cxx | 2 -
sw/source/uibase/uno/unoatxt.cxx | 4 +-
sw/source/uibase/uno/unotxdoc.cxx | 4 +-
toolkit/source/awt/vclxwindow.cxx | 2 -
unoxml/source/dom/document.cxx | 2 -
unoxml/source/dom/elementlist.cxx | 2 -
unoxml/source/dom/node.cxx | 2 -
unoxml/source/events/eventdispatcher.cxx | 4 +-
vcl/source/control/tabctrl.cxx | 4 +-
vcl/unx/generic/print/genprnpsp.cxx | 4 +-
xmloff/source/draw/XMLGraphicsDefaultStyle.cxx | 4 +-
xmloff/source/draw/sdxmlexp.cxx | 2 -
xmloff/source/text/txtimp.cxx | 2 -
143 files changed, 283 insertions(+), 297 deletions(-)
New commits:
commit 72ef2b5d9802c424dbb0810e0a72fae50d92b678
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Nov 22 14:12:34 2017 +0100
Make loplugin:unnecessaryparen warn about (x) ? ... : ... after all
...which had been left out because "lots of our code uses this style, which I'm
loathe to bulk-fix as yet", but now in
<https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have
caused an otherwise innocent-looking code change to trigger a
loplugin:unnecessaryparen warning for
pFormat = (pGrfObj)
? ...
(barring a change to ignoreAllImplicit in
compilerplugins/clang/unnecessaryparen.cxx similar to that in
<https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in
loplugin:simplifybool consistent", which should also have caused the warning to
disappear for the modified code, IIUC).
Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2
Reviewed-on: https://gerrit.libreoffice.org/45088
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index 217e8fa7ea76..a3a61feaa2c5 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -220,7 +220,7 @@ bool MediaWindow::executeMediaURLDialog(const vcl::Window* pParent, OUString& rU
static const char aSeparator[] = ";";
OUString aAllTypes;
- aDlg.SetTitle( AvmResId( (o_pbLink)
+ aDlg.SetTitle( AvmResId( o_pbLink
? AVMEDIA_STR_INSERTMEDIA_DLG : AVMEDIA_STR_OPENMEDIA_DLG ) );
getMediaFilters( aFilters );
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index 042cb480437b..69939ffb2037 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -98,9 +98,9 @@ namespace basegfx
// get the polygon vector we want to plant this arrow on
const double fConsumedLength(fArrowYLength * (1.0 - fDockingPosition) - fShift);
- const B2DVector aHead(rCandidate.getB2DPoint((bStart) ? 0 : rCandidate.count() - 1));
+ const B2DVector aHead(rCandidate.getB2DPoint(bStart ? 0 : rCandidate.count() - 1));
const B2DVector aTail(getPositionAbsolute(rCandidate,
- (bStart) ? fConsumedLength : fCandidateLength - fConsumedLength, fCandidateLength));
+ bStart ? fConsumedLength : fCandidateLength - fConsumedLength, fCandidateLength));
// from that vector, take the needed rotation and add rotate for arrow to transformation
const B2DVector aTargetDirection(aHead - aTail);
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 3d64dee7838b..ea5efa39af39 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -633,7 +633,7 @@ namespace basegfx
if(areParallel(aEdgeVector, aTestVector))
{
- const double fCut((bTestUsingX)
+ const double fCut(bTestUsingX
? aTestVector.getX() / aEdgeVector.getX()
: aTestVector.getY() / aEdgeVector.getY());
const double fZero(0.0);
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 7613a071d3e4..7bffdd7812fd 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -301,7 +301,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
return xErrorBar;
const OUString aPropName(
- (bYError) ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
+ bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) ||
!xErrorBar.is())
{
@@ -326,7 +326,7 @@ Reference< beans::XPropertySet > StatisticsHelper::getErrorBars(
Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
Reference< beans::XPropertySet > xErrorBar;
const OUString aPropName(
- (bYError) ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
+ bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
if ( xSeriesProp.is())
xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar;
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index be1f49b7236c..b72c6da3eea2 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -453,7 +453,7 @@ OUString removeAny(OUString const& rIn,
buf.append(c);
}
}
- return (isFound) ? buf.makeStringAndClear() : rIn;
+ return isFound ? buf.makeStringAndClear() : rIn;
}
OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok,
diff --git a/compilerplugins/clang/test/unnecessaryparen.cxx b/compilerplugins/clang/test/unnecessaryparen.cxx
index d07f4930c4d3..968522d63a73 100644
--- a/compilerplugins/clang/test/unnecessaryparen.cxx
+++ b/compilerplugins/clang/test/unnecessaryparen.cxx
@@ -31,8 +31,7 @@ int main()
case (EFoo::Bar): break; // expected-error {{parentheses immediately inside case statement [loplugin:unnecessaryparen]}}
}
- // lots of our code uses this style, which I'm loathe to bulk-fix as yet
- int z = (y) ? 1 : 0;
+ int z = (y) ? 1 : 0; // expected-error {{unnecessary parentheses around identifier [loplugin:unnecessaryparen]}}
(void)z;
int v1 = (static_cast<short>(1)) + 1; // expected-error {{unnecessary parentheses around cast [loplugin:unnecessaryparen]}}
diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx
index fe3b0dd4b028..fdc83410cb0e 100644
--- a/compilerplugins/clang/unnecessaryparen.cxx
+++ b/compilerplugins/clang/unnecessaryparen.cxx
@@ -83,12 +83,10 @@ public:
bool VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *);
bool TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *);
bool TraverseCaseStmt(CaseStmt *);
- bool TraverseConditionalOperator(ConditionalOperator *);
private:
void VisitSomeStmt(Stmt const * stmt, const Expr* cond, StringRef stmtName);
Expr const * insideSizeof = nullptr;
Expr const * insideCaseStmt = nullptr;
- Expr const * insideConditionalOperator = nullptr;
};
bool UnnecessaryParen::TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr * expr)
@@ -111,15 +109,6 @@ bool UnnecessaryParen::TraverseCaseStmt(CaseStmt * caseStmt)
return ret;
}
-bool UnnecessaryParen::TraverseConditionalOperator(ConditionalOperator * conditionalOperator)
-{
- auto old = insideConditionalOperator;
- insideConditionalOperator = ignoreAllImplicit(conditionalOperator->getCond());
- bool ret = RecursiveASTVisitor::TraverseConditionalOperator(conditionalOperator);
- insideConditionalOperator = old;
- return ret;
-}
-
bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr)
{
if (ignoreLocation(parenExpr))
@@ -130,8 +119,6 @@ bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr)
return true;
if (insideCaseStmt && parenExpr == insideCaseStmt)
return true;
- if (insideConditionalOperator && parenExpr == insideConditionalOperator)
- return true;
auto subExpr = ignoreAllImplicit(parenExpr->getSubExpr());
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 4e16c3f74db3..d724ecacc61d 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -505,7 +505,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
delete pNumFmtShell; // delete old shell if applicable (== reset)
- nInitFormat = ( pValFmtAttr ) // memorize init key
+ nInitFormat = pValFmtAttr // memorize init key
? pValFmtAttr->GetValue() // (for FillItemSet())
: ULONG_MAX; // == DONT_KNOW
@@ -513,13 +513,13 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
if ( eValType == SvxNumberValueType::String )
pNumFmtShell =SvxNumberFormatShell::Create(
pNumItem->GetNumberFormatter(),
- (pValFmtAttr) ? nInitFormat : 0,
+ pValFmtAttr ? nInitFormat : 0,
eValType,
aValString );
else
pNumFmtShell =SvxNumberFormatShell::Create(
pNumItem->GetNumberFormatter(),
- (pValFmtAttr) ? nInitFormat : 0,
+ pValFmtAttr ? nInitFormat : 0,
eValType,
nValDouble,
&aValString );
diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx
index ae9391900db0..8e3149711e57 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.cxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.cxx
@@ -129,7 +129,7 @@ bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent )
ElementType OApplicationSwapWindow::getElementType() const
{
SvxIconChoiceCtrlEntry* pEntry = m_aIconControl->GetSelectedEntry();
- return ( pEntry ) ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE;
+ return pEntry ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE;
}
bool OApplicationSwapWindow::onContainerSelected( ElementType _eType )
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 598e01c2d783..00c2eaf5dddf 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1383,7 +1383,7 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo
{"Parent", uno::Any(xNameAccess)},
{PROPERTY_EMBEDDEDOBJECT, uno::Any(_xContent)},
}));
- OUString sServiceName(_bCollection ? ((_bForm) ? OUString(SERVICE_NAME_FORM_COLLECTION) : OUString(SERVICE_NAME_REPORT_COLLECTION)) : OUString(SERVICE_SDB_DOCUMENTDEFINITION));
+ OUString sServiceName(_bCollection ? (_bForm ? OUString(SERVICE_NAME_FORM_COLLECTION) : OUString(SERVICE_NAME_REPORT_COLLECTION)) : OUString(SERVICE_SDB_DOCUMENTDEFINITION));
Reference<XContent > xNew( xORB->createInstanceWithArguments( sServiceName, aArguments ), UNO_QUERY_THROW );
Reference< XNameContainer > xNameContainer( xNameAccess, UNO_QUERY_THROW );
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 2ee459617553..40eac4395e04 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -55,7 +55,7 @@ namespace drawinglayer
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
const bool bOldSimpleTextureActive(getSimpleTextureActive());
- std::shared_ptr< texture::GeoTexSvx > pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
+ std::shared_ptr< texture::GeoTexSvx > pOldTex = bTransparence ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
// create texture
const attribute::FillGradientAttribute& rFillGradient = rPrimitive.getGradient();
diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx
index 1cf15dcfe7b9..fd831d55febc 100644
--- a/extensions/source/propctrlr/formmetadata.cxx
+++ b/extensions/source/propctrlr/formmetadata.cxx
@@ -368,25 +368,25 @@ namespace pcr
OUString OPropertyInfoService::getPropertyTranslation(sal_Int32 _nId) const
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->sTranslation : OUString();
+ return pInfo ? pInfo->sTranslation : OUString();
}
OString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->sHelpId : OString();
+ return pInfo ? pInfo->sHelpId : OString();
}
sal_Int16 OPropertyInfoService::getPropertyPos(sal_Int32 _nId) const
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->nPos : 0xFFFF;
+ return pInfo ? pInfo->nPos : 0xFFFF;
}
sal_uInt32 OPropertyInfoService::getPropertyUIFlags(sal_Int32 _nId) const
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->nUIFlags : 0;
+ return pInfo ? pInfo->nUIFlags : 0;
}
std::vector< OUString > OPropertyInfoService::getPropertyEnumRepresentations(sal_Int32 _nId) const
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index a155d8d5dd65..694998345361 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -1971,7 +1971,7 @@ void PSWriter::ImplWriteString( const OString& rString, VirtualDevice const & rV
{
if ( i > 0 )
nx = pDXArry[ i - 1 ];
- ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( OUString(rString[i]) ) );
+ ImplWriteDouble( bStretch ? nx : rVDev.GetTextWidth( OUString(rString[i]) ) );
ImplWriteDouble( nx );
ImplWriteLine( "(", PS_NONE );
ImplWriteCharacter( rString[i] );
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index e20d60d3bd69..31c583900e1f 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -221,7 +221,7 @@ double CGM::ImplGetFloat( RealPrecision eRealPrecision, sal_uInt32 nRealSize )
else // ->RP_FIXED
{
long nVal;
- const int nSwitch = ( bCompatible ) ? 0 : 1 ;
+ const int nSwitch = bCompatible ? 0 : 1 ;
if ( nRealSize == 4 )
{
sal_uInt16* pShort = static_cast<sal_uInt16*>(pPtr);
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index b06a325ded6b..128d1556b4c6 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1891,7 +1891,7 @@ bool EscherPropertyContainer::CreatePolygonProperties(
{
css::uno::Any aAny;
bRetValue = EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- ( bBezier ) ? OUString("PolyPolygonBezier") : OUString("PolyPolygon"), true );
+ bBezier ? OUString("PolyPolygonBezier") : OUString("PolyPolygon"), true );
if ( bRetValue )
{
aPolyPolygon = GetPolyPolygon( aAny );
@@ -4003,7 +4003,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
void EscherBlibEntry::WriteBlibEntry( SvStream& rSt, bool bWritePictureOffset, sal_uInt32 nResize )
{
- sal_uInt32 nPictureOffset = ( bWritePictureOffset ) ? mnPictureOffset : 0;
+ sal_uInt32 nPictureOffset = bWritePictureOffset ? mnPictureOffset : 0;
rSt.WriteUInt32( ( ESCHER_BSE << 16 ) | ( ( (sal_uInt16)meBlibType << 4 ) | 2 ) )
.WriteUInt32( 36 + nResize )
@@ -4452,9 +4452,9 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
sal_uInt32 nRule = 0;
css::uno::Any aAny;
- css::awt::Point aRefPoint( ( bFirst ) ? maPointA : maPointB );
+ css::awt::Point aRefPoint( bFirst ? maPointA : maPointB );
css::uno::Reference< css::drawing::XShape >
- aXShape( ( bFirst ) ? mXConnectToA : mXConnectToB );
+ aXShape( bFirst ? mXConnectToA : mXConnectToB );
OUString aString(aXShape->getShapeType());
OStringBuffer aBuf(OUStringToOString(aString, RTL_TEXTENCODING_UTF8));
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 78a8e1b9500a..f1b8c65759d6 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2276,7 +2276,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
}
}
sal_Int32 nParaIndex = pTextObj->GetCurrentIndex();
- SfxStyleSheet* pS = ( ppStyleSheetAry ) ? ppStyleSheetAry[ pPara->mxParaSet->mnDepth ] : pSheet;
+ SfxStyleSheet* pS = ppStyleSheetAry ? ppStyleSheetAry[ pPara->mxParaSet->mnDepth ] : pSheet;
ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
rOutliner.Insert( OUString(), nParaIndex, pPara->mxParaSet->mnDepth );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 95b229723474..824f21be6ccd 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -695,7 +695,7 @@ sal_Int32 SVGTextWriter::setTextPosition( const GDIMetaFile& rMtf, sal_uLong& nC
if( bEmpty )
{
nCurAction = nActionIndex;
- return ( (bEOL) ? -2 : ( (bEOP) ? -1 : 0 ) );
+ return ( bEOL ? -2 : ( bEOP ? -1 : 0 ) );
}
else
{
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 766bc7b141df..2ed63c36af8f 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -434,7 +434,7 @@ bool ToolbarLayoutManager::requestToolbar( const OUString& rResourceURL )
bCreateOrShowToolbar &= bool( xContainerWindow->isActive());
if ( bCreateOrShowToolbar )
- bNotify = ( bMustCallCreate ) ? createToolbar( rResourceURL ) : showToolbar( rResourceURL );
+ bNotify = bMustCallCreate ? createToolbar( rResourceURL ) : showToolbar( rResourceURL );
return bNotify;
}
@@ -3116,7 +3116,7 @@ void ToolbarLayoutManager::implts_renumberRowColumnData(
if ( isDefaultPos( pIter->m_aDockedData.m_aPos ))
continue;
- sal_Int32 nWindowRowCol = ( bHorzDockingArea ) ? pIter->m_aDockedData.m_aPos.Y : pIter->m_aDockedData.m_aPos.X;
+ sal_Int32 nWindowRowCol = bHorzDockingArea ? pIter->m_aDockedData.m_aPos.Y : pIter->m_aDockedData.m_aPos.X;
if ( nWindowRowCol >= nRowCol )
{
if ( bHorzDockingArea )
@@ -3158,7 +3158,7 @@ void ToolbarLayoutManager::implts_renumberRowColumnData(
if ( isDefaultPos( aDockedPos ))
continue;
- sal_Int32 nWindowRowCol = ( bHorzDockingArea ) ? aDockedPos.Y : aDockedPos.X;
+ sal_Int32 nWindowRowCol = bHorzDockingArea ? aDockedPos.Y : aDockedPos.X;
if (( nDockedArea == eDockingArea ) && ( nWindowRowCol >= nRowCol ))
{
if ( bHorzDockingArea )
diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index 87f3ef0c9db6..388c990ee762 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -156,7 +156,7 @@ hchar_string DateCode::GetString()
for (; *fmt && ((int) ret.size() < DATE_SIZE); fmt++)
{
- form = (add_zero) ? "%02d" : "%d";
+ form = add_zero ? "%02d" : "%d";
add_zero = false;
is_pm = (date[HOUR] >= 12);
@@ -230,13 +230,13 @@ hchar_string DateCode::GetString()
break;
case '7':
ret.push_back(0xB5A1);
- ret.push_back((is_pm) ? 0xD281 : 0xB8E5);
+ ret.push_back(is_pm ? 0xD281 : 0xB8E5);
break;
case '&':
- strncat(cbuf, (is_pm) ? "p.m." : "a.m.", sizeof(cbuf) - strlen(cbuf) - 1);
+ strncat(cbuf, is_pm ? "p.m." : "a.m.", sizeof(cbuf) - strlen(cbuf) - 1);
break;
case '+':
- strncat(cbuf, (is_pm) ? "P.M." : "A.M.", sizeof(cbuf) - strlen(cbuf) - 1);
+ strncat(cbuf, is_pm ? "P.M." : "A.M.", sizeof(cbuf) - strlen(cbuf) - 1);
break;
case '8': // 2.5 feature
case '9':
diff --git a/include/osl/file.hxx b/include/osl/file.hxx
index a5823fbe1174..3c2848eaa590 100644
--- a/include/osl/file.hxx
+++ b/include/osl/file.hxx
@@ -1906,7 +1906,7 @@ public:
{
return static_cast< RC >(osl_createDirectoryPath(
aDirectoryUrl.pData,
- (aDirectoryCreationObserver) ? onDirectoryCreated : NULL,
+ aDirectoryCreationObserver ? onDirectoryCreated : NULL,
aDirectoryCreationObserver));
}
};
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 60a2aaff7249..3a4159d35392 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -202,7 +202,7 @@ private:
inline void PushButton::Check( bool bCheck )
{
- SetState( (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE );
+ SetState( bCheck ? TRISTATE_TRUE : TRISTATE_FALSE );
}
inline bool PushButton::IsChecked() const
@@ -474,7 +474,7 @@ public:
inline void CheckBox::Check( bool bCheck )
{
- SetState( (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE );
+ SetState( bCheck ? TRISTATE_TRUE : TRISTATE_FALSE );
}
inline bool CheckBox::IsChecked() const
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 6a936d8e03fa..e6d213027e60 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -518,7 +518,7 @@ public:
inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck )
{
- SetItemState( nItemId, (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE );
+ SetItemState( nItemId, bCheck ? TRISTATE_TRUE : TRISTATE_FALSE );
}
inline bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const
diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx
index aed694c109e0..82732af556f6 100644
--- a/reportdesign/source/ui/inspection/metadata.cxx
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -162,21 +162,21 @@ namespace rptui
OUString OPropertyInfoService::getPropertyTranslation(sal_Int32 _nId)
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->sTranslation : OUString();
+ return pInfo ? pInfo->sTranslation : OUString();
}
OString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId)
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->sHelpId : OString();
+ return pInfo ? pInfo->sHelpId : OString();
}
PropUIFlags OPropertyInfoService::getPropertyUIFlags(sal_Int32 _nId)
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->nUIFlags : PropUIFlags::NONE;
+ return pInfo ? pInfo->nUIFlags : PropUIFlags::NONE;
}
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index c7261f1eec76..3633ee5bfd6c 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -1476,7 +1476,7 @@ oslSocketResult SAL_CALL osl_connectSocketTo(oslSocket pSocket,
nullptr,
PTR_FD_SET(WriteSet),
PTR_FD_SET(ExcptSet),
- (pTimeout) ? &tv : nullptr);
+ pTimeout ? &tv : nullptr);
if (ReadyHandles > 0) /* connected */
{
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 7fd28345c0a6..d1ac259cc33c 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -79,7 +79,7 @@ private:
void doTest(util::Duration const & rid, char const*const pis,
char const*const i_pos = nullptr)
{
- char const*const pos((i_pos) ? i_pos : pis);
+ char const*const pos(i_pos ? i_pos : pis);
util::Duration od;
OUString is(::rtl::OUString::createFromAscii(pis));
SAL_INFO("sax.cppunit","about to convert '" << is << "'");
@@ -155,7 +155,7 @@ bool eqDateTime(const util::DateTime& a, const util::DateTime& b) {
void doTest(util::DateTime const & rdt, char const*const pis,
char const*const i_pos = nullptr)
{
- char const*const pos((i_pos) ? i_pos : pis);
+ char const*const pos(i_pos ? i_pos : pis);
OUString is(OUString::createFromAscii(pis));
util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'");
@@ -249,7 +249,7 @@ void ConverterTest::testDateTime()
void doTestTime(util::DateTime const & rdt, char const*const pis,
char const*const i_pos = nullptr)
{
- char const*const pos((i_pos) ? i_pos : pis);
+ char const*const pos(i_pos ? i_pos : pis);
OUString is(OUString::createFromAscii(pis));
util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'");
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 121ae8a2ffa4..ad5cb8c19113 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -991,7 +991,7 @@ readUnsignedNumber(const OUString & rString,
io_rnPos = nPos;
o_rNumber = nTemp;
- return (bOverflow) ? R_OVERFLOW : R_SUCCESS;
+ return bOverflow ? R_OVERFLOW : R_SUCCESS;
}
static Result
@@ -1035,7 +1035,7 @@ readUnsignedNumberMaxDigits(int maxDigits,
io_rnPos = nPos;
o_rNumber = nTemp;
- return (bOverflow) ? R_OVERFLOW : R_SUCCESS;
+ return bOverflow ? R_OVERFLOW : R_SUCCESS;
}
static bool
@@ -1778,12 +1778,12 @@ static bool lcl_parseDateTime(
if (bSuccess)
{
- sal_Int16 const nTimezoneOffset = ((bHaveTimezoneMinus) ? (-1) : (+1))
+ sal_Int16 const nTimezoneOffset = (bHaveTimezoneMinus ? (-1) : (+1))
* ((nTimezoneHours * 60) + nTimezoneMinutes);
if (!pDate || bHaveTime) // time is optional
{
rDateTime.Year =
- ((isNegative) ? (-1) : (+1)) * static_cast<sal_Int16>(nYear);
+ (isNegative ? (-1) : (+1)) * static_cast<sal_Int16>(nYear);
rDateTime.Month = static_cast<sal_uInt16>(nMonth);
rDateTime.Day = static_cast<sal_uInt16>(nDay);
rDateTime.Hours = static_cast<sal_uInt16>(nHours);
@@ -1818,7 +1818,7 @@ static bool lcl_parseDateTime(
else
{
pDate->Year =
- ((isNegative) ? (-1) : (+1)) * static_cast<sal_Int16>(nYear);
+ (isNegative ? (-1) : (+1)) * static_cast<sal_Int16>(nYear);
pDate->Month = static_cast<sal_uInt16>(nMonth);
pDate->Day = static_cast<sal_uInt16>(nDay);
if (bHaveTimezone)
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 56be6df03201..cd09f5d0247f 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1638,7 +1638,7 @@ CommentCaptionState ScTable::GetAllNoteCaptionsState(const ScRange& rRange, std:
}
}
}
- return (bIsFirstNoteShownState) ? CommentCaptionState::ALLSHOWN : CommentCaptionState::ALLHIDDEN;
+ return bIsFirstNoteShownState ? CommentCaptionState::ALLSHOWN : CommentCaptionState::ALLHIDDEN;
}
void ScTable::GetUnprotectedCells( ScRangeList& rRangeList ) const
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 909965676139..29d9d845b8f6 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -2490,7 +2490,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
double fSSreg = fSlope * fSlope * fSumX2;
pResMat->PutDouble(fSSreg, 0, 4);
- double fDegreesFreedom =static_cast<double>( (bConstant) ? N-2 : N-1 );
+ double fDegreesFreedom =static_cast<double>( bConstant ? N-2 : N-1 );
pResMat->PutDouble(fDegreesFreedom, 1, 3);
double fSSresid = lcl_GetSSresid(pMatX,pMatY,fSlope,N);
@@ -2621,7 +2621,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
pResMat->PutDouble(fSSreg, 0, 4);
pResMat->PutDouble(fSSresid, 1, 4);
- double fDegreesFreedom =static_cast<double>( (bConstant) ? N-K-1 : N-K );
+ double fDegreesFreedom =static_cast<double>( bConstant ? N-K-1 : N-K );
pResMat->PutDouble(fDegreesFreedom, 1, 3);
if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
@@ -2778,7 +2778,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
pResMat->PutDouble(fSSreg, 0, 4);
pResMat->PutDouble(fSSresid, 1, 4);
- double fDegreesFreedom =static_cast<double>( (bConstant) ? N-K-1 : N-K );
+ double fDegreesFreedom =static_cast<double>( bConstant ? N-K-1 : N-K );
pResMat->PutDouble(fDegreesFreedom, 1, 3);
if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 0461d7e48c66..cc69f4ae3c1e 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -737,7 +737,7 @@ bool XclExpAutofilter::AddEntry( const ScQueryEntry& rEntry )
sal_uInt32 nIndex = 0;
bool bIsNum = !bLen || GetFormatter().IsNumberFormat( sText, nIndex, fVal );
OUString* pText;
- (bIsNum) ? pText = nullptr : pText = &sText;
+ bIsNum ? pText = nullptr : pText = &sText;
// top10 flags
sal_uInt16 nNewFlags = 0x0000;
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 39ea16bf683a..1a6b3f56157b 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1372,7 +1372,7 @@ void ScCheckListMenuWindow::updateMemberParents( const SvTreeListEntry* pLeaf, s
if ( pLeaf )
{
SvTreeListEntry* pMonthEntry = pLeaf->GetParent();
- SvTreeListEntry* pYearEntry = ( pMonthEntry ) ? pMonthEntry->GetParent() : nullptr;
+ SvTreeListEntry* pYearEntry = pMonthEntry ? pMonthEntry->GetParent() : nullptr;
maMembers[nIdx].mpParent = pMonthEntry;
if ( aItr != maYearMonthMap.end() )
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index 16767809cc26..79f52c5dd2b6 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -111,7 +111,7 @@ InsertDeleteFlags ScDeleteContentsDlg::GetDelContentsCmdBits() const
ScDeleteContentsDlg::bPreviousAllCheck = aBtnDelAll->IsChecked();
- return ( (ScDeleteContentsDlg::bPreviousAllCheck)
+ return ( ScDeleteContentsDlg::bPreviousAllCheck
? InsertDeleteFlags::ALL
: ScDeleteContentsDlg::nPreviousChecks );
}
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 0845e7627c23..eddd015b646d 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -147,7 +147,7 @@ InsertDeleteFlags ScInsertContentsDlg::GetInsContentsCmdBits() const
if (bUsedShortCut)
return nShortCutInsContentsCmdBits;
- return ( (ScInsertContentsDlg::bPreviousAllCheck)
+ return ( ScInsertContentsDlg::bPreviousAllCheck
? InsertDeleteFlags::ALL
: ScInsertContentsDlg::nPreviousChecks );
}
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 6283edca1486..c627970fd4e2 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1118,7 +1118,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
// Subtitle template
SvxNumBulletItem const*const pItem(
rSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET));
- SvxNumRule *const pDefaultRule = (pItem) ? pItem->GetNumRule() : nullptr;
+ SvxNumRule *const pDefaultRule = pItem ? pItem->GetNumRule() : nullptr;
DBG_ASSERT( pDefaultRule, "Where is my default template? [CL]" );
if(pDefaultRule)
diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx
index a17ee08d6a89..693607413215 100644
--- a/sd/source/filter/eppt/pptx-stylesheet.cxx
+++ b/sd/source/filter/eppt/pptx-stylesheet.cxx
@@ -168,7 +168,7 @@ PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBull
{
nBulletChar = 0x2022;
nBulletOfs = 0;
- nTextOfs = ( bHasBullet ) ? 0xd8 : 0;
+ nTextOfs = bHasBullet ? 0xd8 : 0;
}
break;
case 1 :
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 2c189d79516c..60eb678303b0 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -585,7 +585,7 @@ bool ImplSdPPTImport::Import()
bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bNotesMaster;
bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bStarDrawFiller;
- PageKind ePgKind = ( bNotesMaster ) ? PageKind::Notes : PageKind::Standard;
+ PageKind ePgKind = bNotesMaster ? PageKind::Notes : PageKind::Standard;
bool bHandout = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bHandoutMaster;
if ( bHandout )
ePgKind = PageKind::Handout;
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 8392c0e7f5d1..ea8b5dc326c8 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -681,7 +681,7 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
if(rKEvt.GetKeyCode().IsMod2())
{
OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
- Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
+ Size aLogicSizeOnePixel = pOut ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
nX *= aLogicSizeOnePixel.Width();
nY *= aLogicSizeOnePixel.Height();
}
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 68d2f165c147..e7e5c1a2cba3 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -396,7 +396,7 @@ bool AnnotationTag::OnMove( const KeyEvent& rKEvt )
if(rKEvt.GetKeyCode().IsMod2())
{
OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
- Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
+ Size aLogicSizeOnePixel = pOut ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
nX *= aLogicSizeOnePixel.Width();
nY *= aLogicSizeOnePixel.Height();
}
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 3dbd3503b13a..99dca2efed88 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -455,7 +455,7 @@ OUString ViewShellBase::GetSelectionText(bool bCompleteWords)
std::shared_ptr<ViewShell> const pMainShell(GetMainViewShell());
DrawViewShell *const pDrawViewShell(
dynamic_cast<DrawViewShell*>(pMainShell.get()));
- return (pDrawViewShell)
+ return pDrawViewShell
? pDrawViewShell->GetSelectionText(bCompleteWords)
: SfxViewShell::GetSelectionText(bCompleteWords);
}
@@ -465,7 +465,7 @@ bool ViewShellBase::HasSelection(bool bText) const
std::shared_ptr<ViewShell> const pMainShell(GetMainViewShell());
DrawViewShell *const pDrawViewShell(
dynamic_cast<DrawViewShell*>(pMainShell.get()));
- return (pDrawViewShell)
+ return pDrawViewShell
? pDrawViewShell->HasSelection(bText)
: SfxViewShell::HasSelection(bText);
}
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 93ea92fe6d08..4b83bca30b7a 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1585,7 +1585,7 @@ IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, KeywordHdl, IndexTabPage_Impl&, void)
if( !bIndex)
bIndex = pIPage->HasKeywordIgnoreCase();
// then set index or search page as current.
- sal_uInt16 nPageId = ( bIndex ) ? m_pTabCtrl->GetPageId("index") : m_pTabCtrl->GetPageId("find");
+ sal_uInt16 nPageId = bIndex ? m_pTabCtrl->GetPageId("index") : m_pTabCtrl->GetPageId("find");
if ( nPageId != m_pTabCtrl->GetCurPageId() )
{
m_pTabCtrl->SetCurPageId( nPageId );
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 861a9f1af91d..89048b3d9998 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1433,7 +1433,7 @@ SmNode *SmParser::DoTerm(bool bGroupNumberIdent)
bool bIsAttr;
while ( (bIsAttr = TokenInGroup(TG::Attribute))
|| TokenInGroup(TG::FontAttr))
- aStack.push((bIsAttr) ? DoAttribut() : DoFontAttribut());
+ aStack.push(bIsAttr ? DoAttribut() : DoFontAttribut());
SmNode *pFirstNode = DoPower();
while (!aStack.empty())
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index cbad6e420028..a4b64f2ef042 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -181,7 +181,7 @@ long BorderWidthImpl::GuessWidth( long nLine1, long nLine2, long nGap )
bInvalid = ( nWidth != *pIt );
++pIt;
}
- nWidth = (bInvalid) ? 0.0 : nLine1 + nLine2 + nGap;
+ nWidth = bInvalid ? 0.0 : nLine1 + nLine2 + nGap;
}
return nWidth;
@@ -583,7 +583,7 @@ sal_Int32 LineListBox::GetEntryPos( SvxBorderLineStyle nStyle ) const
SvxBorderLineStyle LineListBox::GetEntryStyle( sal_Int32 nPos ) const
{
ImpLineListData* pData = (0 <= nPos && static_cast<size_t>(nPos) < pLineList->size()) ? (*pLineList)[ nPos ] : nullptr;
- return ( pData ) ? pData->GetStyle() : SvxBorderLineStyle::NONE;
+ return pData ? pData->GetStyle() : SvxBorderLineStyle::NONE;
}
void LineListBox::UpdatePaintLineColor()
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 34f71b8b7c33..03670dbbebb8 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1234,7 +1234,7 @@ void LineEndLB::Fill( const XLineEndListRef &pList, bool bStart )
pVD->DrawBitmap( Point(), aBitmap );
InsertEntry( pEntry->GetName(),
Image(pVD->GetBitmap(
- (bStart) ? Point() : Point(aBmpSize.Width() / 2, 0),
+ bStart ? Point() : Point(aBmpSize.Width() / 2, 0),
Size(aBmpSize.Width() / 2, aBmpSize.Height()))));
}
else
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index b99594b3ee33..036b6472a19b 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -1874,7 +1874,7 @@ void DbGridControl::RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, bool
// positioned on the first sentence
long nDelta = nNewTopRow - GetTopRow();
// limit for relative positioning
- long nLimit = (nCacheSize) ? nCacheSize / 2 : 0;
+ long nLimit = nCacheSize ? nCacheSize / 2 : 0;
// more lines on screen than in cache
if (nLimit < nLinesOnScreen)
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 4ffd872cd7f0..083e7692f7cb 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -251,7 +251,7 @@ namespace sdr
aRegionBoundRect.Left(), aRegionBoundRect.Top(),
aRegionBoundRect.Right(), aRegionBoundRect.Bottom());
- OutputDevice& rTarget = (pPreRenderDevice) ? *pPreRenderDevice : getOutputDevice();
+ OutputDevice& rTarget = pPreRenderDevice ? *pPreRenderDevice : getOutputDevice();
ImpDrawMembers(aRegionRange, rTarget);
}
}
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index a718970689f4..a2bc553580c7 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -153,7 +153,7 @@ namespace sdr
void OverlayManagerBuffered::ImpSaveBackground(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice)
{
// prepare source
- OutputDevice& rSource = (pPreRenderDevice) ? *pPreRenderDevice : getOutputDevice();
+ OutputDevice& rSource = pPreRenderDevice ? *pPreRenderDevice : getOutputDevice();
// Ensure buffer is valid
ImpPrepareBufferDevice();
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 7d6526bcaf0f..992e240540dd 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -124,7 +124,7 @@ void AreaPropertyPanel::setFillStyleAndColor(const XFillStyleItem* pStyleItem,
const XFillColorItem& rColorItem)
{
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_COLOR,
- SfxCallMode::RECORD, (pStyleItem)
+ SfxCallMode::RECORD, pStyleItem
? std::initializer_list<SfxPoolItem const*>{ &rColorItem, pStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &rColorItem });
}
@@ -133,7 +133,7 @@ void AreaPropertyPanel::setFillStyleAndGradient(const XFillStyleItem* pStyleItem
const XFillGradientItem& rGradientItem)
{
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_GRADIENT,
- SfxCallMode::RECORD, (pStyleItem)
+ SfxCallMode::RECORD, pStyleItem
? std::initializer_list<SfxPoolItem const*>{ &rGradientItem, pStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &rGradientItem });
}
@@ -142,7 +142,7 @@ void AreaPropertyPanel::setFillStyleAndHatch(const XFillStyleItem* pStyleItem,
const XFillHatchItem& rHatchItem)
{
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_HATCH,
- SfxCallMode::RECORD, (pStyleItem)
+ SfxCallMode::RECORD, pStyleItem
? std::initializer_list<SfxPoolItem const*>{ &rHatchItem, pStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &rHatchItem });
}
@@ -151,7 +151,7 @@ void AreaPropertyPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem,
const XFillBitmapItem& rBitmapItem)
{
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_BITMAP,
- SfxCallMode::RECORD, (pStyleItem)
+ SfxCallMode::RECORD, pStyleItem
? std::initializer_list<SfxPoolItem const*>{ &rBitmapItem, pStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &rBitmapItem });
}
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 1bde1afca7f0..e7447041e23b 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -964,7 +964,7 @@ bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue() != drawi
void SdrTextFitToSizeTypeItem::SetBoolValue(bool bVal)
{
- SetValue((bVal) ? drawing::TextFitToSizeType_PROPORTIONAL : drawing::TextFitToSizeType_NONE);
+ SetValue(bVal ? drawing::TextFitToSizeType_PROPORTIONAL : drawing::TextFitToSizeType_NONE);
}
bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index be0d4d140eec..c373caac480f 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -212,7 +212,7 @@ void SdrEditView::DeleteLayer(const OUString& rName)
for(sal_uInt16 nPgNum(0); nPgNum < nPgCount; nPgNum++)
{
// over all pages
- SdrPage* pPage = (bMaPg) ? mpModel->GetMasterPage(nPgNum) : mpModel->GetPage(nPgNum);
+ SdrPage* pPage = bMaPg ? mpModel->GetMasterPage(nPgNum) : mpModel->GetPage(nPgNum);
const size_t nObjCount(pPage->GetObjCount());
// make sure OrdNums are correct
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 55e8c175fb41..faf855bc96a4 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -123,16 +123,16 @@ static bool ImpSdrMarkListSorter(SdrMark* const& lhs, SdrMark* const& rhs)
{
SdrObject* pObj1 = lhs->GetMarkedSdrObj();
SdrObject* pObj2 = rhs->GetMarkedSdrObj();
- SdrObjList* pOL1 = (pObj1) ? pObj1->GetObjList() : nullptr;
- SdrObjList* pOL2 = (pObj2) ? pObj2->GetObjList() : nullptr;
+ SdrObjList* pOL1 = pObj1 ? pObj1->GetObjList() : nullptr;
+ SdrObjList* pOL2 = pObj2 ? pObj2->GetObjList() : nullptr;
if (pOL1 == pOL2)
{
// AF: Note that I reverted a change from sal_uInt32 to sal_uLong (made
// for 64bit compliance, #i78198#) because internally in SdrObject
// both nOrdNum and mnNavigationPosition are stored as sal_uInt32.
- sal_uInt32 nObjOrd1((pObj1) ? pObj1->GetNavigationPosition() : 0);
- sal_uInt32 nObjOrd2((pObj2) ? pObj2->GetNavigationPosition() : 0);
+ sal_uInt32 nObjOrd1(pObj1 ? pObj1->GetNavigationPosition() : 0);
+ sal_uInt32 nObjOrd2(pObj2 ? pObj2->GetNavigationPosition() : 0);
return nObjOrd1 < nObjOrd2;
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 3d71630005d0..23e5cfdf8822 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1552,7 +1552,7 @@ bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev)
size_t nSearchBeg = 0;
E3dScene* pScene = nullptr;
- SdrObject* pObjHit = (bPrev) ? pBtmObjHit : pTopObjHit;
+ SdrObject* pObjHit = bPrev ? pBtmObjHit : pTopObjHit;
bool bRemap = dynamic_cast< const E3dCompoundObject* >(pObjHit) != nullptr
&& static_cast<E3dCompoundObject*>(pObjHit)->IsAOrdNumRemapCandidate(pScene);
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index f121952d8992..a03b6f53963c 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1176,7 +1176,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
mbPageBorderOnlyLeftRight(false)
{
aPrefVisiLayers.SetAll();
- eListKind = (bMasterPage) ? SdrObjListKind::MasterPage : SdrObjListKind::DrawPage;
+ eListKind = bMasterPage ? SdrObjListKind::MasterPage : SdrObjListKind::DrawPage;
mpSdrPageProperties.reset(new SdrPageProperties(*this));
}
diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx
index 0ea5fc21ee64..f6b9bd6d7845 100644
--- a/svx/source/svdraw/svdpoev.cxx
+++ b/svx/source/svdraw/svdpoev.cxx
@@ -164,7 +164,7 @@ void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmoot
if(!b1stSegm && !bSegmFuz)
{
- eMarkedSegmentsKind = (bCurve) ? SdrPathSegmentKind::Curve : SdrPathSegmentKind::Line;
+ eMarkedSegmentsKind = bCurve ? SdrPathSegmentKind::Curve : SdrPathSegmentKind::Line;
}
}
diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx
index 3c0ab9badb08..6ef07497b40b 100644
--- a/svx/source/svdraw/svdviter.cxx
+++ b/svx/source/svdraw/svdviter.cxx
@@ -38,7 +38,7 @@ void SdrViewIter::ImpInitVars()
SdrViewIter::SdrViewIter(const SdrPage* pPage)
{
mpPage = pPage;
- mpModel = (pPage) ? pPage->GetModel() : nullptr;
+ mpModel = pPage ? pPage->GetModel() : nullptr;
mpObject = nullptr;
mbNoMasterPage = false;
ImpInitVars();
@@ -48,8 +48,8 @@ SdrViewIter::SdrViewIter(const SdrPage* pPage)
SdrViewIter::SdrViewIter(const SdrObject* pObject)
{
mpObject = pObject;
- mpModel = (pObject) ? pObject->GetModel() : nullptr;
- mpPage = (pObject) ? pObject->GetPage() : nullptr;
+ mpModel = pObject ? pObject->GetModel() : nullptr;
+ mpPage = pObject ? pObject->GetPage() : nullptr;
mbNoMasterPage = false;
if(!mpModel || !mpPage)
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index f763b7869825..661ce1700f76 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -787,7 +787,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void)
// #i122676# Change FillStyle and Gradinet in one call
SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD,
- (bFillStyleChange)
+ bFillStyleChange
? std::initializer_list<SfxPoolItem const*>{ &aXFillGradientItem, &aXFillStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &aXFillGradientItem });
}
@@ -820,7 +820,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void)
// #i122676# Change FillStyle and Hatch in one call
SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
SID_ATTR_FILL_HATCH, SfxCallMode::RECORD,
- (bFillStyleChange)
+ bFillStyleChange
? std::initializer_list<SfxPoolItem const*>{ &aXFillHatchItem, &aXFillStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &aXFillHatchItem });
}
@@ -853,7 +853,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void)
// #i122676# Change FillStyle and Bitmap in one call
SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD,
- (bFillStyleChange)
+ bFillStyleChange
? std::initializer_list<SfxPoolItem const*>{ &aXFillBitmapItem, &aXFillStyleItem }
: std::initializer_list<SfxPoolItem const*>{ &aXFillBitmapItem });
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 3d1328a44a2e..f5eb6a14c375 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -2813,7 +2813,7 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertySimpl
if(pPageObj)
{
SdrPage* pPage = pPageObj->GetReferencedPage();
- sal_Int32 nPageNumber = (pPage) ? pPage->GetPageNum() : 0L;
+ sal_Int32 nPageNumber = pPage ? pPage->GetPageNum() : 0L;
nPageNumber++;
nPageNumber >>= 1;
rValue <<= nPageNumber;
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index 42d1ac40d15f..cd87db46817a 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -186,7 +186,7 @@ void SwRegionRects::Compress()
}
}
}
- i = (bRestart) ? 0 : i+1;
+ i = bRestart ? 0 : i+1;
}
}
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index fae0f3e69a04..8c1a0627f1d0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1780,10 +1780,10 @@ bool SwCursorShell::SelectTextAttr( sal_uInt16 nWhich,
{
SwPosition& rPos = *m_pCurrentCursor->GetPoint();
SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode();
- pTextAttr = (pTextNd)
+ pTextAttr = pTextNd
? pTextNd->GetTextAttrAt(rPos.nContent.GetIndex(),
static_cast<RES_TXTATR>(nWhich),
- (bExpand) ? SwTextNode::EXPAND : SwTextNode::DEFAULT)
+ bExpand ? SwTextNode::EXPAND : SwTextNode::DEFAULT)
: nullptr;
}
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index cfe9031e2f3d..3eed69cbc92a 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -1152,7 +1152,7 @@ int SwFindParaAttr::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove, con
const_cast< SwPaM* >(pRegion)->GetRingContainer().merge( m_rCursor.GetRingContainer() );
}
- std::unique_ptr<OUString> pRepl( (bRegExp) ?
+ std::unique_ptr<OUString> pRepl( bRegExp ?
ReplaceBackReferences( *pSearchOpt, pCursor ) : nullptr );
m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( *pCursor,
(pRepl.get()) ? *pRepl : pSearchOpt->replaceString,
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index fc360eea94af..d63d66cbf41d 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -80,7 +80,7 @@ lcl_CleanStr(const SwTextNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd,
if ( bNewSoftHyphen )
{
- nSoftHyphen = (bRemoveSoftHyphen)
+ nSoftHyphen = bRemoveSoftHyphen
? rNd.GetText().indexOf(CHAR_SOFTHYPHEN, nSoftHyphen)
: -1;
}
@@ -679,7 +679,7 @@ int SwFindParaText::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove,
const_cast<SwPaM*>(pRegion)->GetRingContainer().merge( m_rCursor.GetRingContainer() );
}
- std::unique_ptr<OUString> pRepl( (bRegExp)
+ std::unique_ptr<OUString> pRepl( bRegExp
? ReplaceBackReferences( m_rSearchOpt, pCursor ) : nullptr );
bool const bReplaced =
m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange(
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index 1f40f610d805..24561ebd9e51 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -52,7 +52,7 @@ bool SwCursor::GotoFootnoteText()
bool bRet = false;
SwTextNode* pTextNd = GetPoint()->nNode.GetNode().GetTextNode();
- SwTextAttr *const pFootnote( (pTextNd)
+ SwTextAttr *const pFootnote( pTextNd
? pTextNd->GetTextAttrForCharAt(
GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN)
: nullptr);
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f5d491cd1bc8..a364e7ef5204 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3226,7 +3226,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly(
*aCpyPaM.GetPoint() = pCopiedPaM->second;
}
- lcl_CopyBookmarks((pCopiedPaM) ? pCopiedPaM->first : aRgTmp, aCpyPaM);
+ lcl_CopyBookmarks(pCopiedPaM ? pCopiedPaM->first : aRgTmp, aCpyPaM);
}
if( bDelRedlines && ( RedlineFlags::DeleteRedlines & pDest->getIDocumentRedlineAccess().GetRedlineFlags() ))
@@ -4344,7 +4344,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if( !bCopyOk )
{
- const sal_Int32 nCpyLen = ( (bOneNode)
+ const sal_Int32 nCpyLen = ( bOneNode
? pEnd->nContent.GetIndex()
: pSttTextNd->GetText().getLength())
- pStt->nContent.GetIndex();
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index 775f62ba3509..f0e1609c115f 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -1573,7 +1573,7 @@ SwField * DocumentFieldsManager::GetFieldAtPos(const SwPosition & rPos)
{
SwTextField * const pAttr = GetTextFieldAtPos(rPos);
- return (pAttr) ? const_cast<SwField *>( pAttr->GetFormatField().GetField() ) : nullptr;
+ return pAttr ? const_cast<SwField *>( pAttr->GetFormatField().GetField() ) : nullptr;
}
SwTextField * DocumentFieldsManager::GetTextFieldAtPos(const SwPosition & rPos)
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 02a5dac0a256..4a1fe172789a 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -115,10 +115,10 @@ namespace
SwSection* pSect = pSectFormat->GetSection();
if( pSect )
{
- OUString sNm( (bCaseSensitive)
+ OUString sNm( bCaseSensitive
? pSect->GetSectionName()
: GetAppCharClass().lowercase( pSect->GetSectionName() ));
- OUString sCompare( (bCaseSensitive)
+ OUString sCompare( bCaseSensitive
? pItem->m_Item
: GetAppCharClass().lowercase( pItem->m_Item ) );
if( sNm == sCompare )
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index eea50f39ce25..dbd288c0662b 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1706,7 +1706,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
return (nullptr != pNewRedl)
? AppendResult::APPENDED
- : ((bMerged) ? AppendResult::MERGED : AppendResult::IGNORED);
+ : (bMerged ? AppendResult::MERGED : AppendResult::IGNORED);
}
bool DocumentRedlineManager::AppendTableRowRedline( SwTableRowRedline* pNewRedl, bool )
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index c9c7d58a0c3d..0595503430d9 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1657,7 +1657,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo )
--pTmp->GetPoint()->nNode;
SwContentNode *const pContentNode( pTmp->GetContentNode() );
pTmp->GetPoint()->nContent.Assign( pContentNode,
- (pContentNode) ? pContentNode->Len() : 0 );
+ pContentNode ? pContentNode->Len() : 0 );
// tdf#106218 try to avoid losing a paragraph break here:
if (pTmp->GetMark()->nContent == 0)
{
@@ -1700,7 +1700,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo )
--pTmp->GetPoint()->nNode;
SwContentNode *const pContentNode( pTmp->GetContentNode() );
pTmp->GetPoint()->nContent.Assign( pContentNode,
- (pContentNode) ? pContentNode->Len() : 0 );
+ pContentNode ? pContentNode->Len() : 0 );
// tdf#106218 try to avoid losing a paragraph break here:
if (pTmp->GetMark()->nContent == 0)
{
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 2e73dd1d850e..c62ceb64cb4b 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -172,7 +172,7 @@ void SwDoc::CorrAbs(const SwNodeIndex& rOldNode,
{
SwContentNode *const pContentNode( rOldNode.GetNode().GetContentNode() );
SwPaM const aPam(rOldNode, 0,
- rOldNode, (pContentNode) ? pContentNode->Len() : 0);
+ rOldNode, pContentNode ? pContentNode->Len() : 0);
SwPosition aNewPos(rNewPos);
aNewPos.nContent += nOffset;
@@ -233,7 +233,7 @@ void SwDoc::CorrAbs(
{
SwContentNode *const pContentNode( rEndNode.GetNode().GetContentNode() );
SwPaM const aPam(rStartNode, 0,
- rEndNode, (pContentNode) ? pContentNode->Len() : 0);
+ rEndNode, pContentNode ? pContentNode->Len() : 0);
::PaMCorrAbs(aPam, rNewPos);
}
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 55986aafae5f..bffbc59e30c7 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -277,10 +277,10 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHe
// The ContentIdx is _always_ different when called from
// SwDocStyleSheet::SetItemSet, because it deep-copies the
// PageDesc. So check if it was previously shared.
- ((bFirst) ? rDesc.IsFirstShared() : rDesc.IsHeaderShared()))
+ (bFirst ? rDesc.IsFirstShared() : rDesc.IsHeaderShared()))
{
SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
- (bFirst) ? "First header" : "Left header",
+ bFirst ? "First header" : "Left header",
GetDfltFrameFormat() );
::lcl_DescSetAttr( *pRight, *pFormat, false );
// The section which the right header attribute is pointing
@@ -349,10 +349,10 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFo
// The ContentIdx is _always_ different when called from
// SwDocStyleSheet::SetItemSet, because it deep-copies the
// PageDesc. So check if it was previously shared.
- ((bFirst) ? rDesc.IsFirstShared() : rDesc.IsFooterShared()))
+ (bFirst ? rDesc.IsFirstShared() : rDesc.IsFooterShared()))
{
SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
- (bFirst) ? "First footer" : "Left footer",
+ bFirst ? "First footer" : "Left footer",
GetDfltFrameFormat() );
::lcl_DescSetAttr( *pRight, *pFormat, false );
// The section to which the right footer attribute is pointing
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 8c208a97e125..e7c35433eb7d 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -165,7 +165,7 @@ bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const OUString& rEntry,
aCpyPam.GetPoint()->nNode = pGDoc->GetNodes().GetEndOfContent().GetIndex()-1;
pContentNd = aCpyPam.GetContentNode();
aCpyPam.GetPoint()->nContent.Assign(
- pContentNd, (pContentNd) ? pContentNd->Len() : 0 );
+ pContentNd, pContentNd ? pContentNd->Len() : 0 );
GetIDocumentUndoRedo().StartUndo( SwUndoId::INSGLOSSARY, nullptr );
SwPaM *_pStartCursor = &rPaM, *_pStartCursor2 = _pStartCursor;
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 8c8edb5ed218..c8a1d4ccbbce 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -280,7 +280,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
--pEndPos->nNode;
pTNd = pEndPos->nNode.GetNode().GetTextNode();
}
- nContent = (pTNd) ? pTNd->GetText().getLength() : 0;
+ nContent = pTNd ? pTNd->GetText().getLength() : 0;
pEndPos->nContent.Assign( pTNd, nContent );
}
}
@@ -985,7 +985,7 @@ lcl_initParent(SwSectionNode & rThis, SwSectionFormat & rFormat)
SwSectionNode::SwSectionNode(SwNodeIndex const& rIdx,
SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase)
: SwStartNode( rIdx, SwNodeType::Section )
- , m_pSection( (pTOXBase)
+ , m_pSection( pTOXBase
? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFormat))
: new SwSection( CONTENT_SECTION, rFormat.GetName(),
lcl_initParent(*this, rFormat) ) )
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 957e8e2cf60c..ab6d21065392 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3966,7 +3966,7 @@ bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, TableChgWidthHeightType e
{
bRet = pTableNd->GetTable().SetColWidth( rAktBox,
eType, nAbsDiff, nRelDiff,
- (bUndo) ? &pUndo : nullptr );
+ bUndo ? &pUndo : nullptr );
}
break;
case TableChgWidthHeightType::RowTop:
@@ -3975,7 +3975,7 @@ bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, TableChgWidthHeightType e
case TableChgWidthHeightType::CellBottom:
bRet = pTableNd->GetTable().SetRowHeight( rAktBox,
eType, nAbsDiff, nRelDiff,
- (bUndo) ? &pUndo : nullptr );
+ bUndo ? &pUndo : nullptr );
break;
default: break;
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index f5ab64dc57f0..c9f3ad9c22ce 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1479,7 +1479,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
// move the content into the new node
bool bOneNd = pStt->nNode == pEnd->nNode;
const sal_Int32 nLen =
- ( (bOneNd) ? std::min(pEnd->nContent.GetIndex(), pSrcNd->Len()) : pSrcNd->Len() )
+ ( bOneNd ? std::min(pEnd->nContent.GetIndex(), pSrcNd->Len()) : pSrcNd->Len() )
- pStt->nContent.GetIndex();
if( !pEnd->nNode.GetNode().IsContentNode() )
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 5a59b878dee1..0a1e5083d4a9 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -351,7 +351,7 @@ bool SwSection::IsProtect() const
{
SwSectionFormat const *const pFormat( GetFormat() );
OSL_ENSURE(pFormat, "SwSection::IsProtect: no format?");
- return (pFormat)
+ return pFormat
? pFormat->GetProtect().IsContentProtected()
: IsProtectFlag();
}
@@ -361,7 +361,7 @@ bool SwSection::IsEditInReadonly() const
{
SwSectionFormat const *const pFormat( GetFormat() );
OSL_ENSURE(pFormat, "SwSection::IsEditInReadonly: no format?");
- return (pFormat)
+ return pFormat
? pFormat->GetEditInReadonly().GetValue()
: IsEditInReadonlyFlag();
}
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index e958a24b0d50..fbce36232d08 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -374,7 +374,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos,
aCpyPam.GetPoint()->nNode.Assign( pAutoDoc->GetNodes().GetEndOfContent(), -1 );
pContentNd = aCpyPam.GetContentNode();
aCpyPam.GetPoint()->nContent.Assign(
- pContentNd, (pContentNd) ? pContentNd->Len() : 0);
+ pContentNd, pContentNd ? pContentNd->Len() : 0);
SwDontExpandItem aExpItem;
aExpItem.SaveDontExpandItems( *aPam.GetPoint() );
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index c901cbe9f005..4737f411cd8d 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -153,7 +153,7 @@ void SwEditShell::Insert2(SwField const & rField, const bool bForceExpandHints)
StartAllAction();
SwFormatField aField( rField );
- const SetAttrMode nInsertFlags = (bForceExpandHints)
+ const SetAttrMode nInsertFlags = bForceExpandHints
? SetAttrMode::FORCEHINTEXPAND
: SetAttrMode::DEFAULT;
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 7c49f728d3d6..98f6288bba39 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -135,7 +135,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
aCpyPam.GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1;
pContentNd = aCpyPam.GetContentNode();
aCpyPam.GetPoint()->nContent.Assign(
- pContentNd, (pContentNd) ? pContentNd->Len() : 0);
+ pContentNd, pContentNd ? pContentNd->Len() : 0);
aStt = pGDoc->GetNodes().GetEndOfExtras();
pContentNd = pGDoc->GetNodes().GoNext( &aStt );
@@ -159,7 +159,7 @@ bool SwEditShell::CopySelToDoc( SwDoc* pInsDoc )
SwNodeIndex aIdx( rNds.GetEndOfContent(), -1 );
SwContentNode *const pContentNode = aIdx.GetNode().GetContentNode();
SwPosition aPos( aIdx,
- SwIndex(pContentNode, (pContentNode) ? pContentNode->Len() : 0));
+ SwIndex(pContentNode, pContentNode ? pContentNode->Len() : 0));
bool bRet = false;
SET_CURR_SHELL( this );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 0f9662f01f16..0cd05f4e1d0f 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -87,7 +87,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints )
StartAllAction();
{
const SwInsertFlags nInsertFlags =
- (bForceExpandHints)
+ bForceExpandHints
? (SwInsertFlags::FORCEHINTEXPAND | SwInsertFlags::EMPTYEXPAND)
: SwInsertFlags::EMPTYEXPAND;
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 4591c535d6a5..1decb5dc36a3 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -139,7 +139,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
{ // fdo#39003 Pop does not touch the rest of the cursor ring
KillPams(); // so call this first to get rid of unwanted cursors
}
- Pop((bRestoreCursor) ? PopMode::DeleteCurrent : PopMode::DeleteStack);
+ Pop(bRestoreCursor ? PopMode::DeleteCurrent : PopMode::DeleteStack);
GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOld );
GetDoc()->getIDocumentRedlineAccess().CompressRedlines();
@@ -190,7 +190,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount)
SAL_WARN("sw.core", "SwEditShell::Redo(): exception caught: " << e);
}
- Pop((bRestoreCursor) ? PopMode::DeleteCurrent : PopMode::DeleteStack);
+ Pop(bRestoreCursor ? PopMode::DeleteCurrent : PopMode::DeleteStack);
GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOld );
GetDoc()->getIDocumentRedlineAccess().CompressRedlines();
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index 3448535eee06..749bfe58bc62 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -97,7 +97,7 @@ OUString SwTableField::GetCommand()
if (EXTRNL_NAME != GetNameType())
{
SwNode const*const pNd = GetNodeOfFormula();
- SwTableNode const*const pTableNd = (pNd) ? pNd->FindTableNode() : nullptr;
+ SwTableNode const*const pTableNd = pNd ? pNd->FindTableNode() : nullptr;
if (pTableNd)
{
PtrToBoxNm( &pTableNd->GetTable() );
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index cfcced343bd3..4c465df866c6 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -892,7 +892,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc )
SwNode & rNode(rPaM.GetPoint()->nNode.GetNode());
SwContentNode *const pContentNode( rNode.GetContentNode() );
SwPaM const tmpPam(rNode, 0,
- rNode, (pContentNode) ? pContentNode->Len() : 0);
+ rNode, pContentNode ? pContentNode->Len() : 0);
::PaMCorrAbs(tmpPam, aPos);
}
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index a7a64db7d461..0b0644de0a6a 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1218,7 +1218,7 @@ bool SwFEShell::UpdateTableStyleFormatting(SwTableNode *pTableNode,
return false;
}
- OUString const aTableStyleName((pStyleName)
+ OUString const aTableStyleName(pStyleName
? *pStyleName
: pTableNode->GetTable().GetTableStyleName());
SwTableAutoFormat* pTableStyle = GetDoc()->GetTableStyles().FindAutoFormat(aTableStyleName);
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index ab52c310ec93..37a3b2bd44ae 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1523,7 +1523,7 @@ void SwFormatAnchor::SetAnchor( const SwPosition *pPos )
dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode()))
|| (RndStdIds::FLY_AT_PARA == m_eAnchorId && dynamic_cast<SwTableNode*>(&pPos->nNode.GetNode()))
|| dynamic_cast<SwTextNode*>(&pPos->nNode.GetNode()));
- m_pContentAnchor .reset( (pPos) ? new SwPosition( *pPos ) : nullptr );
+ m_pContentAnchor .reset( pPos ? new SwPosition( *pPos ) : nullptr );
// Flys anchored AT paragraph should not point into the paragraph content
if (m_pContentAnchor &&
((RndStdIds::FLY_AT_PARA == m_eAnchorId) || (RndStdIds::FLY_AT_FLY == m_eAnchorId)))
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index bf4f102b1409..83043c78278f 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1417,7 +1417,7 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs,
bPrevLineSpacingPorportional );
if( rIDSA.get(DocumentSettingId::PARA_SPACE_MAX) )
{
- nUpper = (bContextualSpacing) ? 0 : nPrevLowerSpace + pAttrs->GetULSpace().GetUpper();
+ nUpper = bContextualSpacing ? 0 : nPrevLowerSpace + pAttrs->GetULSpace().GetUpper();
SwTwips nAdd = nPrevLineSpacing;
// OD 07.01.2004 #i11859# - consideration of the line spacing
// for the upper spacing of a text frame
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 2956f4315a11..b35a5e1e1e40 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1017,7 +1017,7 @@ void SwFrame::CheckPageDescs( SwPageFrame *pStart, bool bNotifyFields, SwPageFra
bool bIsOdd = pPage->OnRightPage();
bool bWantOdd = pPage->WannaRightPage();
bool bFirst = pPage->OnFirstPage();
- SwFrameFormat *pFormatWish = (bWantOdd)
+ SwFrameFormat *pFormatWish = bWantOdd
? pDesc->GetRightFormat(bFirst) : pDesc->GetLeftFormat(bFirst);
if ( bIsOdd != bWantOdd ||
@@ -1058,7 +1058,7 @@ void SwFrame::CheckPageDescs( SwPageFrame *pStart, bool bNotifyFields, SwPageFra
pNextPage->GetPageDesc() == (pNextDesc = pNextPage->FindPageDesc()) ) //4.
{
bool bNextFirst = pNextPage->OnFirstPage();
- SwFrameFormat *pNextFormatWish = (bNextWantOdd) ? //5.
+ SwFrameFormat *pNextFormatWish = bNextWantOdd ? //5.
pNextDesc->GetRightFormat(bNextFirst) : pNextDesc->GetLeftFormat(bNextFirst);
if ( !pNextFormatWish ) // 6.
pNextFormatWish = bNextWantOdd ? pNextDesc->GetLeftFormat() : pNextDesc->GetRightFormat();
@@ -1292,7 +1292,7 @@ SwPageFrame *SwFrame::InsertPage( SwPageFrame *pPrevPage, bool bFootnote )
pPrevPage->GetPageDesc(), bFootnote, nullptr ) )
bCheckPages = true;
}
- SwFrameFormat *const pFormat( (bWishedOdd)
+ SwFrameFormat *const pFormat( bWishedOdd
? pDesc->GetRightFormat(bWishedFirst)
: pDesc->GetLeftFormat(bWishedFirst) );
assert(pFormat);
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 13651d275d67..38d56884e609 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -325,7 +325,7 @@ bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
SwFrameFormat *SwPageDesc::GetLeftFormat(bool const bFirst)
{
return (UseOnPage::Left & m_eUse)
- ? ((bFirst) ? &m_FirstLeft : &m_Left)
+ ? (bFirst ? &m_FirstLeft : &m_Left)
: nullptr;
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 6e687eddd781..b1f08ca7fd8e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2795,13 +2795,13 @@ void SwTabFramePainter::Insert( const SwFrame& rFrame, const SvxBoxItem& rBoxIte
aB.SetRefMode( !bVert ? svx::frame::RefMode::Begin : svx::frame::RefMode::End );
SwLineEntry aLeft (nLeft, nTop, nBottom,
- (bVert) ? aB : ((bR2L) ? aR : aL));
+ bVert ? aB : (bR2L ? aR : aL));
SwLineEntry aRight (nRight, nTop, nBottom,
- (bVert) ? ((bBottomAsTop) ? aB : aT) : ((bR2L) ? aL : aR));
+ bVert ? (bBottomAsTop ? aB : aT) : (bR2L ? aL : aR));
SwLineEntry aTop (nTop, nLeft, nRight,
- (bVert) ? aL : ((bBottomAsTop) ? aB : aT));
+ bVert ? aL : (bBottomAsTop ? aB : aT));
SwLineEntry aBottom(nBottom, nLeft, nRight,
- (bVert) ? aR : aB);
+ bVert ? aR : aB);
Insert( aLeft, false );
Insert( aRight, false );
@@ -4652,7 +4652,7 @@ static void lcl_MakeBorderLine(SwRect const& rRect,
basegfx::B2DPoint aEnd;
if (isVertical)
{ // fdo#38635: always from outer edge
- double const fStartX( (isLeftOrTopBorder)
+ double const fStartX( isLeftOrTopBorder
? rRect.Left() + (rRect.Width() / 2.0)
: rRect.Right() - (rRect.Width() / 2.0));
aStart.setX(fStartX);
@@ -4664,7 +4664,7 @@ static void lcl_MakeBorderLine(SwRect const& rRect,
}
else
{ // fdo#38635: always from outer edge
- double const fStartY( (isLeftOrTopBorder)
+ double const fStartY( isLeftOrTopBorder
? rRect.Top() + (rRect.Height() / 2.0)
: rRect.Bottom() - (rRect.Height() / 2.0));
aStart.setX(rRect.Left() +
@@ -7454,7 +7454,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap )
SwIterator<SwFrame,SwFormat> aIter( *this );
SwFrame *pFirst = aIter.First();
SwViewShell *const pSh =
- (pFirst) ? pFirst->getRootFrame()->GetCurrShell() : nullptr;
+ pFirst ? pFirst->getRootFrame()->GetCurrShell() : nullptr;
if (nullptr != pSh)
{
SwViewShell *pOldGlobal = gProp.pSGlobalShell;
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index f5a1c7b017de..b028322d8601 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -278,7 +278,7 @@ bool SwPageFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint,
// try this again but prefer the "previous" position
SwCursorMoveState aMoveState;
- SwCursorMoveState *const pState((pCMS) ? pCMS : &aMoveState);
+ SwCursorMoveState *const pState(pCMS ? pCMS : &aMoveState);
comphelper::FlagRestorationGuard g(
pState->m_bPosMatchesBounds, true);
SwPosition prevTextPos(*pPos);
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 500485d26c95..1312f5dce36a 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1921,7 +1921,7 @@ bool SwTable::GetInfo( SfxPoolItem& rInfo ) const
SwTable * SwTable::FindTable( SwFrameFormat const*const pFormat )
{
- return (pFormat)
+ return pFormat
? SwIterator<SwTable,SwFormat>(*pFormat).First()
: nullptr;
}
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 32736e5cba1b..d25fcc2ba0b1 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -368,7 +368,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
- const sal_uInt16 nGridWidth = (bHasGrid) ? GetGridWidth(*pGrid, *pDoc) : 0;
+ const sal_uInt16 nGridWidth = bHasGrid ? GetGridWidth(*pGrid, *pDoc) : 0;
// used for grid mode only:
// the pointer is stored, because after formatting of non-asian text,
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 08b5c744a57d..6b2b9388644d 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -91,7 +91,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
}
SwViewShell *pSh = rInf.GetVsh();
- SwDoc *const pDoc( (pSh) ? pSh->GetDoc() : nullptr );
+ SwDoc *const pDoc( pSh ? pSh->GetDoc() : nullptr );
bool const bInClipboard( pDoc == nullptr || pDoc->IsClipBoard() );
bool bPlaceHolder = false;
@@ -113,7 +113,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
case SwFieldIds::HiddenText:
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwHiddenPortion(aStr);
@@ -127,7 +127,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
&static_txtattr_cast<SwTextField const*>(pHint)->GetTextNode());
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion( aStr );
@@ -140,7 +140,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
static_cast<SwDocStatField*>(pField)->ChangeExpansion( pFrame );
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion( aStr );
@@ -168,7 +168,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
bVirt, nNumFormat != (SvxNumType)-1 ? &nNumFormat : nullptr);
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion( aStr );
@@ -196,7 +196,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
}
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion( aStr );
@@ -211,7 +211,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
pDBField->ChgBodyTextFlag( ::lcl_IsInBody( pFrame ) );
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion(aStr);
@@ -225,7 +225,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
static_txtattr_cast<SwTextField const*>(pHint));
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion(aStr);
@@ -241,7 +241,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
case SwFieldIds::GetRef:
subType = static_cast<SwGetRefField*>(pField)->GetSubType();
{
- OUString const str( (bName)
+ OUString const str( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion(str);
@@ -254,7 +254,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
case SwFieldIds::DateTime:
subType = static_cast<SwDateTimeField*>(pField)->GetSubType();
{
- OUString const str( (bName)
+ OUString const str( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion(str);
@@ -266,7 +266,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
break;
default:
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion(aStr);
@@ -282,7 +282,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf,
pTmpFnt->SetDiffFnt( &pChFormat->GetAttrSet(), m_pFrame->GetTextNode()->getIDocumentSettingAccess() );
}
{
- OUString const aStr( (bName)
+ OUString const aStr( bName
? pField->GetFieldName()
: pField->ExpandField(bInClipboard) );
pRet = new SwFieldPortion(aStr, pTmpFnt, bPlaceHolder);
@@ -301,7 +301,7 @@ static SwFieldPortion * lcl_NewMetaPortion(SwTextAttr & rHint, const bool bPrefi
OSL_ENSURE(pField, "lcl_NewMetaPortion: no meta field?");
if (pField)
{
- pField->GetPrefixAndSuffix((bPrefix) ? &fix : nullptr, (bPrefix) ? nullptr : &fix);
+ pField->GetPrefixAndSuffix(bPrefix ? &fix : nullptr, bPrefix ? nullptr : &fix);
}
return new SwFieldPortion( fix );
}
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 1a0a9a2c8828..af72d11df73d 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -361,7 +361,7 @@ auto SwWrongList::Fresh( sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPos,
// length of word must be greater than 0
// only report a spelling error if the cursor position is outside the word,
// so that the user is not annoyed while typing
- FreshState eRet = (nLen)
+ FreshState eRet = nLen
? (nCursorPos > nPos + nLen || nCursorPos < nPos)
? FreshState::FRESH
: FreshState::CURSOR
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 86e0053b6b31..55275b0e8c80 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -732,7 +732,7 @@ void MetaField::GetPrefixAndSuffix(
SwTextNode * const pTextNode( GetTextNode() );
SwDocShell const * const pShell(pTextNode->GetDoc()->GetDocShell());
const uno::Reference<frame::XModel> xModel(
- (pShell) ? pShell->GetModel() : nullptr, uno::UNO_SET_THROW);
+ pShell ? pShell->GetModel() : nullptr, uno::UNO_SET_THROW);
getPrefixAndSuffix(xModel, xMetaField, o_pPrefix, o_pSuffix);
}
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 297f307d8d04..e68b019b24d7 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1336,7 +1336,7 @@ lcl_GetTextAttrs(
sal_Int32 const nIndex, RES_TXTATR const nWhich,
enum SwTextNode::GetTextAttrMode const eMode)
{
- size_t const nSize = (pSwpHints) ? pSwpHints->Count() : 0;
+ size_t const nSize = pSwpHints ? pSwpHints->Count() : 0;
sal_Int32 nPreviousIndex(0); // index of last hint with nWhich
bool (*pMatchFunc)(sal_Int32, sal_Int32, sal_Int32)=nullptr;
switch (eMode)
@@ -1366,7 +1366,7 @@ lcl_GetTextAttrs(
assert(pEndIdx || pHint->HasDummyChar());
// If EXPAND is set, simulate the text input behavior, i.e.
// move the start, and expand the end.
- bool const bContained( (pEndIdx)
+ bool const bContained( pEndIdx
? (*pMatchFunc)(nIndex, nHintStart, *pEndIdx)
: (nHintStart == nIndex) );
if (bContained)
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 98addf34991a..92c8de9a89db 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -251,7 +251,7 @@ lcl_DoSplitNew(NestList_t & rSplits, SwTextNode & rNode,
const sal_Int32 nOtherStart, const sal_Int32 nOtherEnd, bool bOtherDummy)
{
const bool bSplitAtStart(nNewStart < nOtherStart);
- const sal_Int32 nSplitPos( (bSplitAtStart) ? nOtherStart : nOtherEnd );
+ const sal_Int32 nSplitPos( bSplitAtStart ? nOtherStart : nOtherEnd );
// first find the portion that is split (not necessarily the last one!)
NestList_t::iterator const iter(
std::find_if( rSplits.begin(), rSplits.end(),
@@ -2718,8 +2718,8 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
// this loop needs to handle the case where one has a CHARFMT and the
// other CHARFMT + RSID-only AUTOFMT, so...
// want to skip over RSID-only AUTOFMT here, hence the -1
- if ((nAttributesInPor1 - ((isRsidOnlyAutoFormat1) ? 1 : 0)) ==
- (nAttributesInPor2 - ((isRsidOnlyAutoFormat2) ? 1 : 0))
+ if ((nAttributesInPor1 - (isRsidOnlyAutoFormat1 ? 1 : 0)) ==
+ (nAttributesInPor2 - (isRsidOnlyAutoFormat2 ? 1 : 0))
&& (nAttributesInPor1 != 0 || nAttributesInPor2 != 0))
{
// _if_ there is one element more either in aRange1 or aRange2
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 7d01bbe9c1d9..60d24750cd51 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1425,7 +1425,7 @@ SwRect SwTextFrame::AutoSpell_( const SwContentNode* pActNode, sal_Int32 nActPos
pNode->GetWrong()->SetInvalid( nInvStart, nInvEnd );
pNode->SetWrongDirty(
(COMPLETE_STRING != pNode->GetWrong()->GetBeginInv())
- ? ((bPending)
+ ? (bPending
? SwTextNode::WrongState::PENDING
: SwTextNode::WrongState::TODO)
: SwTextNode::WrongState::DONE);
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index f72f77a2f953..751115d22a59 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -671,7 +671,7 @@ bool UndoManager::Repeat(::sw::RepeatContext & rContext,
{
return false;
}
- SwUndoId const nId((pSwAction)
+ SwUndoId const nId(pSwAction
? pSwAction->GetId()
: static_cast<SwUndoId>(pListAction->GetId()));
if (DoesUndo())
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 6787c6a3125b..809b0848dcc5 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -376,7 +376,7 @@ bool SwUndoDelete::SaveContent( const SwPosition* pStt, const SwPosition* pEnd,
pHistory->CopyFormatAttr( *pSttTextNd->GetpSwAttrSet(), nNdIdx );
// the length might have changed (!!Fields!!)
- sal_Int32 nLen = ((bOneNode)
+ sal_Int32 nLen = (bOneNode
? pEnd->nContent.GetIndex()
: pSttTextNd->GetText().getLength())
- pStt->nContent.GetIndex();
@@ -392,7 +392,7 @@ bool SwUndoDelete::SaveContent( const SwPosition* pStt, const SwPosition* pEnd,
bool emptied( !m_pSttStr->isEmpty() && !pSttTextNd->Len() );
if (!bOneNode || emptied) // merging may overwrite xmlids...
{
- m_pMetadataUndoStart = (emptied)
+ m_pMetadataUndoStart = emptied
? pSttTextNd->CreateUndoForDelete()
: pSttTextNd->CreateUndo();
}
@@ -427,7 +427,7 @@ bool SwUndoDelete::SaveContent( const SwPosition* pStt, const SwPosition* pEnd,
// METADATA: store
bool emptied = !m_pEndStr->isEmpty() && !pEndTextNd->Len();
- m_pMetadataUndoEnd = (emptied)
+ m_pMetadataUndoEnd = emptied
? pEndTextNd->CreateUndoForDelete()
: pEndTextNd->CreateUndo();
}
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index e2b3c08fc15c..f17cae630316 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -73,7 +73,7 @@ SwUndoInsSection::SwUndoInsSection(
SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase)
: SwUndo( SwUndoId::INSSECTION, rPam.GetDoc() ), SwUndRng( rPam )
, m_pSectionData(new SwSectionData(rNewData))
- , m_pTOXBase( (pTOXBase) ? new SwTOXBase(*pTOXBase) : nullptr )
+ , m_pTOXBase( pTOXBase ? new SwTOXBase(*pTOXBase) : nullptr )
, m_pAttrSet( (pSet && pSet->Count()) ? new SfxItemSet( *pSet ) : nullptr )
, m_nSectionNodePos(0)
, m_bSplitAtStart(false)
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 13ca1b40db25..d3212fbbe245 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -213,7 +213,7 @@ void SwXBookmark::attachToRangeEx(
}
SwDoc *const pDoc =
- (pRange) ? &pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : nullptr);
+ pRange ? &pRange->GetDoc() : (pCursor ? pCursor->GetDoc() : nullptr);
if (!pDoc)
{
throw lang::IllegalArgumentException();
@@ -377,7 +377,7 @@ uno::Reference<frame::XModel> SwXBookmark::GetModel()
if (m_pImpl->m_pDoc)
{
SwDocShell const * const pShell( m_pImpl->m_pDoc->GetDocShell() );
- return (pShell) ? pShell->GetModel() : nullptr;
+ return pShell ? pShell->GetModel() : nullptr;
}
return nullptr;
}
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 9e1b3babed4d..fac07e39e4c1 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -275,15 +275,15 @@ GetNestedTextContent(SwTextNode const & rTextNode, sal_Int32 const nIndex,
bool const bParent)
{
// these should be unambiguous because of the dummy character
- SwTextNode::GetTextAttrMode const eMode( (bParent)
+ SwTextNode::GetTextAttrMode const eMode( bParent
? SwTextNode::PARENT : SwTextNode::EXPAND );
SwTextAttr *const pMetaTextAttr =
rTextNode.GetTextAttrAt(nIndex, RES_TXTATR_META, eMode);
SwTextAttr *const pMetaFieldTextAttr =
rTextNode.GetTextAttrAt(nIndex, RES_TXTATR_METAFIELD, eMode);
// which is innermost?
- SwTextAttr *const pTextAttr = (pMetaTextAttr)
- ? ((pMetaFieldTextAttr)
+ SwTextAttr *const pTextAttr = pMetaTextAttr
+ ? (pMetaFieldTextAttr
? ((pMetaFieldTextAttr->GetStart() >
pMetaTextAttr->GetStart())
? pMetaFieldTextAttr : pMetaTextAttr)
@@ -514,7 +514,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry
const SwPosition *pPos = rPam.Start();
const SwTextNode *pTextNd =
rPam.GetDoc()->GetNodes()[pPos->nNode.GetIndex()]->GetTextNode();
- const SwTextAttr* pTextAttr = (pTextNd)
+ const SwTextAttr* pTextAttr = pTextNd
? pTextNd->GetFieldTextAttrAt( pPos->nContent.GetIndex(), true )
: nullptr;
if ( pTextAttr != nullptr )
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 9d0b21b2cbc5..d5c26341af07 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -548,7 +548,7 @@ SwXFieldMaster::CreateXFieldMaster(SwDoc * pDoc, SwFieldType *const pType,
}
if (!xFM.is())
{
- SwXFieldMaster *const pFM( (pType)
+ SwXFieldMaster *const pFM( pType
? new SwXFieldMaster(*pType, pDoc)
: new SwXFieldMaster(pDoc, nResId));
xFM.set(pFM);
@@ -1137,10 +1137,10 @@ public:
, m_pDoc(pDoc)
, m_bIsDescriptor(pFormat == nullptr)
, m_bCallUpdate(false)
- , m_nServiceId((pFormat)
+ , m_nServiceId(pFormat
? lcl_GetServiceForField(*pFormat->GetField())
: nServiceId)
- , m_pProps((pFormat) ? nullptr : new SwFieldProperties_Impl)
+ , m_pProps(pFormat ? nullptr : new SwFieldProperties_Impl)
{ }
virtual ~Impl() override
@@ -1222,7 +1222,7 @@ SwXTextField::CreateXTextField(SwDoc *const pDoc, SwFormatField const* pFormat,
}
if (!xField.is())
{
- SwXTextField *const pField( (pFormat)
+ SwXTextField *const pField( pFormat
? new SwXTextField(const_cast<SwFormatField&>(*pFormat), *pDoc)
: new SwXTextField(nServiceId, pDoc));
xField.set(pField);
@@ -1907,7 +1907,7 @@ void SAL_CALL SwXTextField::attach(
pTextCursor
&& pTextCursor->IsAtEndOfMeta() );
const SetAttrMode nInsertFlags =
- (bForceExpandHints)
+ bForceExpandHints
? SetAttrMode::FORCEHINTEXPAND
: SetAttrMode::DEFAULT;
@@ -2323,7 +2323,7 @@ uno::Any SAL_CALL SwXTextField::getPropertyValue(const OUString& rPropertyName)
// get text node for the text field
const SwFormatField *pFieldFormat =
(m_pImpl->GetField()) ? m_pImpl->m_pFormatField : nullptr;
- const SwTextField* pTextField = (pFieldFormat)
+ const SwTextField* pTextField = pFieldFormat
? m_pImpl->m_pFormatField->GetTextField() : nullptr;
if(!pTextField)
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list