summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-26 14:47:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 11:11:27 +0200
commit6561fc32afaa0ca992ae988b6d08c62e3e516d43 (patch)
tree79c8385626c1707688f75ce04fe92af1c0ae6249 /svx
parentf65f34d630f02c0d9f8c6e5e28dff56e6208ab4f (diff)
loplugin:oncevar in svx
Change-Id: I22a3a13e059ac7d3479f12860564fe3eb1b55e44 Reviewed-on: https://gerrit.libreoffice.org/39282 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/qa/unit/xoutdev.cxx2
-rw-r--r--svx/source/accessibility/AccessibleShape.cxx3
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx3
-rw-r--r--svx/source/dialog/pagectrl.cxx4
-rw-r--r--svx/source/dialog/pagenumberlistbox.cxx3
-rw-r--r--svx/source/dialog/passwd.cxx3
-rw-r--r--svx/source/dialog/srchdlg.cxx3
-rw-r--r--svx/source/dialog/svxruler.cxx3
-rw-r--r--svx/source/engine3d/view3d.cxx5
-rw-r--r--svx/source/engine3d/view3d1.cxx3
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx2
-rw-r--r--svx/source/fmcomp/fmgridif.cxx3
-rw-r--r--svx/source/form/ParseContext.cxx2
-rw-r--r--svx/source/form/datanavi.cxx15
-rw-r--r--svx/source/form/fmPropBrw.cxx3
-rw-r--r--svx/source/form/fmshimp.cxx7
-rw-r--r--svx/source/form/tbxform.cxx2
-rw-r--r--svx/source/gallery2/gallery1.cxx3
-rw-r--r--svx/source/items/numfmtsh.cxx6
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx3
-rw-r--r--svx/source/sidebar/nbdtmg.cxx17
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx3
-rw-r--r--svx/source/stbctrls/pszctrl.cxx3
-rw-r--r--svx/source/svdraw/svdedtv1.cxx10
-rw-r--r--svx/source/svdraw/svdibrow.cxx3
-rw-r--r--svx/source/svdraw/svdoashp.cxx13
-rw-r--r--svx/source/svdraw/svdopath.cxx3
-rw-r--r--svx/source/table/accessiblecell.cxx6
-rw-r--r--svx/source/tbxctrls/linectrl.cxx4
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx3
-rw-r--r--svx/source/toolbars/extrusionbar.cxx3
-rw-r--r--svx/source/uitest/sdrobject.cxx6
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx3
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx3
-rw-r--r--svx/source/unodraw/unoshap4.cxx4
-rw-r--r--svx/source/xml/xmlgrhlp.cxx9
36 files changed, 59 insertions, 112 deletions
diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx
index 2cc088609104..0f0451f3cf2a 100644
--- a/svx/qa/unit/xoutdev.cxx
+++ b/svx/qa/unit/xoutdev.cxx
@@ -52,7 +52,7 @@ void XOutdevTest::testPdfGraphicExport()
// Export it.
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
- XOutFlags eFlags = XOutFlags::DontExpandFilename | XOutFlags::DontAddExtension | XOutFlags::UseNativeIfPossible;
+ XOutFlags const eFlags = XOutFlags::DontExpandFilename | XOutFlags::DontAddExtension | XOutFlags::UseNativeIfPossible;
OUString aTempURL = aTempFile.GetURL();
XOutBitmap::WriteGraphic(aGraphic, aTempURL, "pdf", eFlags);
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index de059e9bb7fd..ac3347c15ff2 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -1441,8 +1441,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
}
sal_Int32 SAL_CALL AccessibleShape::getHyperLinkIndex( sal_Int32 )
{
- sal_Int32 nRet = 0;
- return nRet;
+ return 0;
}
// XAccessibleText
sal_Int32 SAL_CALL AccessibleShape::getCaretPosition( ){return 0;}
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
index ee94039c02b4..a97d6e0b9f03 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
@@ -245,8 +245,7 @@ public:
{
EnhancedCustomShapeParameter aRet;
- sal_Int32 nDummy = 1;
- aRet.Value <<= nDummy;
+ aRet.Value <<= sal_Int32(1);
switch( meFunct )
{
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index 1af0c97f9139..8bd66e4ecb96 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -311,8 +311,8 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO
long nW = aRect.GetWidth();
long nH = aRect.GetHeight();
- long nTW = CELL_WIDTH * 3;
- long nTH = CELL_HEIGHT * 3;
+ long const nTW = CELL_WIDTH * 3;
+ long const nTH = CELL_HEIGHT * 3;
long _nLeft = bHorz ? aRect.Left() + ((nW - nTW) / 2) : aRect.Left();
long _nTop = bVert ? aRect.Top() + ((nH - nTH) / 2) : aRect.Top();
tools::Rectangle aCellRect(Point(_nLeft, _nTop),Size(CELL_WIDTH, CELL_HEIGHT));
diff --git a/svx/source/dialog/pagenumberlistbox.cxx b/svx/source/dialog/pagenumberlistbox.cxx
index 88d6789cf18e..37b8f6a56188 100644
--- a/svx/source/dialog/pagenumberlistbox.cxx
+++ b/svx/source/dialog/pagenumberlistbox.cxx
@@ -58,7 +58,6 @@ void PageNumberListBox::SetSelection( sal_uInt16 nPos )
{
sal_Int32 nEntryCount = GetEntryCount();
sal_Int32 nSelPos = LISTBOX_ENTRY_NOTFOUND;
- sal_Int32 nUserPos = LISTBOX_ENTRY_NOTFOUND;
for (sal_Int32 i = 0; i < nEntryCount; ++i )
{
@@ -70,7 +69,7 @@ void PageNumberListBox::SetSelection( sal_uInt16 nPos )
break;
}
}
- SelectEntryPos( ( nSelPos != LISTBOX_ENTRY_NOTFOUND ) ? nSelPos : nUserPos );
+ SelectEntryPos( ( nSelPos != LISTBOX_ENTRY_NOTFOUND ) ? nSelPos : LISTBOX_ENTRY_NOTFOUND );
}
Size PageNumberListBox::GetOptimalSize() const
diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx
index ef8a0372a1cc..b5e37d9f8dcd 100644
--- a/svx/source/dialog/passwd.cxx
+++ b/svx/source/dialog/passwd.cxx
@@ -26,7 +26,6 @@
IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl, Button*, void)
{
bool bOK = true;
- short nRet = RET_OK;
if ( m_pNewPasswdED->GetText() != m_pRepeatPasswdED->GetText() )
{
@@ -46,7 +45,7 @@ IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl, Button*, void)
}
if ( bOK )
- EndDialog( nRet );
+ EndDialog( RET_OK );
}
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 2fbeeaf30088..7cad95a43cd9 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -519,8 +519,7 @@ void SvxSearchDialog::Construct_Impl()
if(xDirectAccess.is())
{
OUString sTemp;
- OUString sProperty( "ComponentSearchGroupLabel");
- uno::Any aRet = xDirectAccess->getByName(sProperty);
+ uno::Any aRet = xDirectAccess->getByName("ComponentSearchGroupLabel");
aRet >>= sTemp;
m_pComponentFrame->get_label_widget()->SetText(sTemp);
aRet = xDirectAccess->getByName("ComponentSearchCommandLabel1");
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 806b36e17004..d57304baf2a3 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3171,8 +3171,7 @@ bool SvxRuler::StartDrag()
{
if( bContentProtected )
return false;
- sal_uInt16 nIndent = INDENT_LEFT_MARGIN;
- if((nIndent) == GetDragAryPos() + INDENT_GAP) { // Left paragraph indent
+ if(INDENT_LEFT_MARGIN == GetDragAryPos() + INDENT_GAP) { // Left paragraph indent
mpIndents[0] = mpIndents[INDENT_FIRST_LINE];
EvalModifier();
}
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 0995dd13f7f2..c48e2238c222 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -977,10 +977,7 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1
}
// Set default rotation
- {
- double XRotateDefault = 20;
- aRotate.rotate(DEG2RAD(XRotateDefault), 0.0, 0.0);
- }
+ aRotate.rotate(DEG2RAD(20.0), 0.0, 0.0);
if(!aRotate.isIdentity())
{
diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx
index 27cf4a30e5b9..1e8909606cc5 100644
--- a/svx/source/engine3d/view3d1.cxx
+++ b/svx/source/engine3d/view3d1.cxx
@@ -54,8 +54,7 @@ void E3dView::ConvertMarkedToPolyObj()
auto pScene = dynamic_cast< const E3dScene* >(pObj);
if (pScene)
{
- bool bBezier = false;
- pNewObj = pScene->ConvertToPolyObj(bBezier, false/*bLineToArea*/);
+ pNewObj = pScene->ConvertToPolyObj(false/*bBezier*/, false/*bLineToArea*/);
if (pNewObj)
{
BegUndo(SvxResId(RID_SVX_3D_UNDO_EXTRUDE));
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index ad34d09abec7..d1ce99b84dcb 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -1478,7 +1478,7 @@ bool FmGridControl::isColumnMarked(sal_uInt16 nId) const
long FmGridControl::QueryMinimumRowHeight()
{
- long nMinimalLogicHeight = 20; // 0.2 cm
+ long const nMinimalLogicHeight = 20; // 0.2 cm
long nMinimalPixelHeight = LogicToPixel( Point( 0, nMinimalLogicHeight ), MapUnit::Map10thMM ).Y();
return CalcZoom( nMinimalPixelHeight );
}
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index ee4f1c23aa84..21f1043dfcb2 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -407,8 +407,7 @@ void SAL_CALL FmXGridControl::dispose()
OUString FmXGridControl::GetComponentServiceName()
{
- OUString aName("DBGrid");
- return aName;
+ return OUString("DBGrid");
}
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 82f432ac9192..d9e0a43e4b5c 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -129,7 +129,7 @@ IParseContext::InternationalKeyCode OSystemParseContext::getIntlKeyCode(const OS
InternationalKeyCode::Collect, InternationalKeyCode::Fusion, InternationalKeyCode::Intersection
};
- sal_uInt32 nCount = SAL_N_ELEMENTS(Intl_TokenID);
+ sal_uInt32 const nCount = SAL_N_ELEMENTS(Intl_TokenID);
for (sal_uInt32 i = 0; i < nCount; i++)
{
OString aKey = getIntlKeywordAscii(Intl_TokenID[i]);
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 2d940705e3a1..a57a9164f823 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -737,11 +737,10 @@ namespace svxform
{
try
{
- OUString sDelim( ": " );
OUString sTemp;
pNode->m_xPropSet->getPropertyValue( PN_BINDING_ID ) >>= sTemp;
sNewName += sTemp;
- sNewName += sDelim;
+ sNewName += ": ";
pNode->m_xPropSet->getPropertyValue( PN_BINDING_EXPR ) >>= sTemp;
sNewName += sTemp;
}
@@ -858,11 +857,10 @@ namespace svxform
{
try
{
- OUString sDelim( ": " );
OUString sName;
_rEntry->getPropertyValue( PN_BINDING_ID ) >>= sTemp;
sName += sTemp;
- sName += sDelim;
+ sName += ": ";
_rEntry->getPropertyValue( PN_BINDING_EXPR ) >>= sTemp;
sName += sTemp;
pEntry = m_pItemList->InsertEntry(
@@ -1161,7 +1159,6 @@ namespace svxform
if ( xNum.is() && xNum->hasMoreElements() )
{
Image aImage(BitmapEx(RID_SVXBMP_ELEMENT));
- OUString sDelim( ": " );
while ( xNum->hasMoreElements() )
{
Reference< XPropertySet > xPropSet;
@@ -1172,7 +1169,7 @@ namespace svxform
OUString sTemp;
xPropSet->getPropertyValue( PN_BINDING_ID ) >>= sTemp;
sEntry += sTemp;
- sEntry += sDelim;
+ sEntry += ": ";
xPropSet->getPropertyValue( PN_BINDING_EXPR ) >>= sTemp;
sEntry += sTemp;
@@ -2013,12 +2010,11 @@ namespace svxform
void DataNavigatorWindow::CreateInstancePage( const Sequence< PropertyValue >& _xPropSeq )
{
OUString sInstName;
- OUString sID( PN_INSTANCE_ID );
const PropertyValue* pProps = _xPropSeq.getConstArray();
const PropertyValue* pPropsEnd = pProps + _xPropSeq.getLength();
for ( ; pProps != pPropsEnd; ++pProps )
{
- if ( sID == pProps->Name )
+ if ( PN_INSTANCE_ID == pProps->Name )
{
pProps->Value >>= sInstName;
break;
@@ -3233,7 +3229,6 @@ namespace svxform
Reference < XEnumeration > xNum = xNumAccess->createEnumeration();
if ( xNum.is() && xNum->hasMoreElements() )
{
- OUString sDelim( ": " );
while ( xNum->hasMoreElements() )
{
Reference< XPropertySet > xPropSet;
@@ -3244,7 +3239,7 @@ namespace svxform
OUString sTemp;
xPropSet->getPropertyValue( PN_BINDING_ID ) >>= sTemp;
sEntry += sTemp;
- sEntry += sDelim;
+ sEntry += ": ";
xPropSet->getPropertyValue( PN_BINDING_EXPR ) >>= sTemp;
sEntry += sTemp;
m_pBindLB->InsertEntry( sEntry );
diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index 7b8e4d02f9e0..93f7c5bd2339 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -564,8 +564,7 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell )
if ( !m_xBrowserController.is() )
{
- OUString sServiceName( "com.sun.star.inspection.ObjectInspector" );
- ShowServiceNotAvailableError( GetParent(), sServiceName, true );
+ ShowServiceNotAvailableError( GetParent(), "com.sun.star.inspection.ObjectInspector", true );
}
else
{
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 37cc0f4b59f1..bb780941d291 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3119,7 +3119,6 @@ void FmXFormShell::CreateExternalView()
bool bAlreadyExistent = m_xExternalViewController.is();
Reference< css::frame::XFrame> xExternalViewFrame;
OUString sFrameName("_beamer");
- sal_Int32 nSearchFlags = css::frame::FrameSearchFlag::CHILDREN | css::frame::FrameSearchFlag::CREATE;
Reference< runtime::XFormController > xCurrentNavController( getNavController());
// the creation of the "partwindow" may cause a deactivate of the document which will result in our nav controller to be set to NULL
@@ -3161,7 +3160,8 @@ void FmXFormShell::CreateExternalView()
Reference< css::frame::XDispatchProvider> xProv(m_xAttachedFrame, UNO_QUERY);
Reference< css::frame::XDispatch> xDisp;
if (xProv.is())
- xDisp = xProv->queryDispatch(aWantToDispatch, sFrameName, nSearchFlags);
+ xDisp = xProv->queryDispatch(aWantToDispatch, sFrameName,
+ css::frame::FrameSearchFlag::CHILDREN | css::frame::FrameSearchFlag::CREATE);
if (xDisp.is())
{
xDisp->dispatch(aWantToDispatch, Sequence< PropertyValue>());
@@ -3423,8 +3423,7 @@ void FmXFormShell::CreateExternalView()
// content type
pListBoxDescription->Name = FM_PROP_LISTSOURCETYPE;
- ListSourceType eType = ListSourceType_VALUELIST;
- pListBoxDescription->Value <<= eType;
+ pListBoxDescription->Value <<= ListSourceType_VALUELIST;
++pListBoxDescription;
// list source
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 6acf7747cc79..b2051704ce33 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -206,7 +206,7 @@ SvxFmTbxCtlRecTotal::~SvxFmTbxCtlRecTotal()
VclPtr<vcl::Window> SvxFmTbxCtlRecTotal::CreateItemWindow( vcl::Window* pParent )
{
pFixedText.reset(VclPtr<FixedText>::Create( pParent ));
- OUString aSample("123456");
+ OUString const aSample("123456");
Size aSize( pFixedText->GetTextWidth( aSample ), pFixedText->GetTextHeight( ) );
aSize.Width() += 12;
pFixedText->SetSizePixel( aSize );
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 46bebc7032b2..38abd6a0b9e7 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -275,9 +275,8 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
{
// check readonlyness the very hard way
INetURLObject aTestURL( rBaseURL );
- OUString aTestFile( "cdefghij.klm" );
- aTestURL.Append( aTestFile );
+ aTestURL.Append( "cdefghij.klm" );
std::unique_ptr<SvStream> pTestStm(::utl::UcbStreamHelper::CreateStream( aTestURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE ));
if( pTestStm )
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 72d6f67ad1cc..9d46140d83e6 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -793,11 +793,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL
short nMyCat = SELPOS_NONE;
- NfIndexTableOffset eOffsetStart=NF_CURRENCY_START;
- NfIndexTableOffset eOffsetEnd=NF_CURRENCY_END;
- long nIndex;
-
- for(nIndex=eOffsetStart;nIndex<=eOffsetEnd;nIndex++)
+ for(long nIndex=NF_CURRENCY_START; nIndex<=NF_CURRENCY_END; nIndex++)
{
nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage);
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
index ca5e5139aa1a..36b62dd15e57 100644
--- a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
+++ b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
@@ -135,8 +135,7 @@ void AreaTransparencyGradientPopup::ExecuteValueModify(sal_uInt8 nStartCol, sal_
mrAreaPropertyPanel.SetGradient(aTmpGradient);
- bool bEnable = true;
- XFillFloatTransparenceItem aGradientItem(aTmpGradient, bEnable );
+ XFillFloatTransparenceItem aGradientItem(aTmpGradient, true );
mrAreaPropertyPanel.setFillFloatTransparence(aGradientItem);
}
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index aa690a5d7be6..5144e4023bea 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -187,7 +187,6 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename)
if (nVersion==DEFAULT_NUMBERING_CACHE_FORMAT_VERSION) //first version
{
xIStm->ReadInt32( nNumIndex );
- sal_uInt16 nLevel = 0x1;
while (nNumIndex>=0 && nNumIndex<DEFAULT_NUM_VALUSET_COUNT) {
SvxNumRule aNum(*xIStm);
//bullet color in font properties is not stored correctly. Need set tranparency bits manually
@@ -203,7 +202,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename)
aNum.SetLevel(i, aFmt);
}
}
- RelplaceNumRule(aNum,nNumIndex,nLevel);
+ RelplaceNumRule(aNum,nNumIndex,0x1/*nLevel*/);
xIStm->ReadInt32( nNumIndex );
}
}
@@ -230,9 +229,8 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename)
SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
10, false,
SvxNumRuleType::NUMBERING, SvxNumberFormat::LABEL_ALIGNMENT);
- sal_uInt16 nLevel = 0x1;
xOStm->WriteInt32( nItem );
- ApplyNumRule(aDefNumRule,nItem,nLevel,false,true);
+ ApplyNumRule(aDefNumRule,nItem,0x1/*nLevel*/,false,true);
aDefNumRule.Store(*xOStm);
}
}
@@ -628,7 +626,7 @@ void OutlineTypeMgr::Init()
sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*mLevel*/,sal_uInt16 nFromIndex)
{
- sal_uInt16 nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
+ sal_uInt16 const nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
for(sal_uInt16 iDex = nFromIndex; iDex < nLength; iDex++)
{
bool bNotMatch = false;
@@ -702,7 +700,7 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*m
void OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel)
{
- sal_uInt16 nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
+ sal_uInt16 const nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
if ( nIndex >= nLength )
return;
@@ -878,9 +876,8 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1
OUString OutlineTypeMgr::GetDescription(sal_uInt16 nIndex, bool isDefault)
{
OUString sRet;
- sal_uInt16 nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
- if ( nIndex >= nLength )
+ if ( nIndex >= SAL_N_ELEMENTS(pOutlineSettingsArrs) )
return sRet;
else
{
@@ -898,9 +895,7 @@ bool OutlineTypeMgr::IsCustomized(sal_uInt16 nIndex)
{
bool bRet = false;
- sal_uInt16 nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
-
- if ( nIndex >= nLength )
+ if ( nIndex >= SAL_N_ELEMENTS(pOutlineSettingsArrs) )
return bRet;
else
{
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index 3cce2b308a21..b499c686bb28 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -126,9 +126,8 @@ void TextCharacterSpacingControl::Initialize()
{
MapUnit eUnit = GetCoreMetric();
MapUnit eOrgUnit = eUnit;
- MapUnit ePntUnit(MapUnit::MapPoint);
long nBig = maEditKerning->Normalize(nKerning);
- nKerning = LogicToLogic(nBig, eOrgUnit, ePntUnit);
+ nKerning = LogicToLogic(nBig, eOrgUnit, MapUnit::MapPoint);
maEditKerning->SetValue(nKerning);
}
else if(SfxItemState::DISABLED == eState)
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index f009e3e8af50..1999b5a1465c 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -63,11 +63,10 @@ OUString SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal )
{
// deliver and set the Metric of the application
FieldUnit eOutUnit = SfxModule::GetModuleFieldUnit( getFrameInterface() );
- FieldUnit eInUnit = FUNIT_100TH_MM;
OUString sMetric;
const sal_Unicode cSep = Application::GetSettings().GetLocaleDataWrapper().getNumDecimalSep()[0];
- sal_Int64 nConvVal = MetricField::ConvertValue( nVal * 100, 0L, 0, eInUnit, eOutUnit );
+ sal_Int64 nConvVal = MetricField::ConvertValue( nVal * 100, 0L, 0, FUNIT_100TH_MM, eOutUnit );
if ( nConvVal < 0 && ( nConvVal / 100 == 0 ) )
sMetric += "-";
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 3ccc98c14546..243a9ee5869f 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -792,7 +792,6 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const
SdrLayerID nLayerId(0);
bool bLayerDC=false;
OUString aObjName;
- bool bObjNameDC=false,bObjNameSet=false;
long nSnapPosX=0; bool bSnapPosXDC=false;
long nSnapPosY=0; bool bSnapPosYDC=false;
long nSnapWdt=0; bool bSnapWdtDC=false;
@@ -848,14 +847,7 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const
if (!bLogicHgtDiff && aSnapRect.GetHeight()!=aLogicRect.GetHeight()) bLogicHgtDiff=true;
}
}
- if (!bObjNameDC ) {
- if (!bObjNameSet) {
- aObjName=pObj->GetName();
- } else {
- if (!aObjName.equals(pObj->GetName()))
- bObjNameDC = true;
- }
- }
+ aObjName=pObj->GetName();
}
if (bSnapPosXDC || nAllSnapPosX!=nSnapPosX) rAttr.Put(SdrAllPositionXItem(nAllSnapPosX));
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index ee42d01815d8..c692fd14aaec 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -580,7 +580,6 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
rIndent=0;
if (pSet==nullptr) return false;
const SfxPoolItem* pItem=nullptr;
- bool bRet = false;
switch (nWhich) {
case XATTR_LINEDASH :
case XATTR_LINEWIDTH :
@@ -832,7 +831,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
}
} break;
} // switch
- return bRet;
+ return false;
}
sal_uInt16 ImpSortWhich(sal_uInt16 nWhich)
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index da385ef00df5..f672e5072c48 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -744,21 +744,18 @@ static void lcl_ShapePropertiesFromDFF( const SvxMSDffHandle* pData, css::beans:
}
if ( nFlags & SvxMSDffHandleFlags::MIRRORED_X )
{
- bool bMirroredX = true;
rPropValues[ n ].Name = "MirroredX";
- rPropValues[ n++ ].Value <<= bMirroredX;
+ rPropValues[ n++ ].Value <<= true;
}
if ( nFlags & SvxMSDffHandleFlags::MIRRORED_Y )
{
- bool bMirroredY = true;
rPropValues[ n ].Name = "MirroredY";
- rPropValues[ n++ ].Value <<= bMirroredY;
+ rPropValues[ n++ ].Value <<= true;
}
if ( nFlags & SvxMSDffHandleFlags::SWITCHED )
{
- bool bSwitched = true;
rPropValues[ n ].Name = "Switched";
- rPropValues[ n++ ].Value <<= bSwitched;
+ rPropValues[ n++ ].Value <<= true;
}
if ( nFlags & SvxMSDffHandleFlags::POLAR )
{
@@ -2088,8 +2085,8 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
- sal_uInt32 nDefaultObjectSizeWidth = 3000; // default width from SDOptions ?
- sal_uInt32 nDefaultObjectSizeHeight= 3000;
+ sal_uInt32 const nDefaultObjectSizeWidth = 3000; // default width from SDOptions ?
+ sal_uInt32 const nDefaultObjectSizeHeight= 3000;
if ( ImpVerticalSwitch( *this ) )
{
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index d4f5ef2e824c..62e71e615d6b 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -289,7 +289,6 @@ XPolygon ImpPathCreateUser::GetFormPoly() const
void ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const Point& rDir, bool bMouseDown)
{
- bool bRet = true;
aBezStart=rP1;
aBezCtrl1=rP1+rDir;
aBezCtrl2=rP2;
@@ -298,7 +297,7 @@ void ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const Poi
// Also copy the end point when no end point is set yet
if (!bMouseDown || (0L == aBezEnd.X() && 0L == aBezEnd.Y())) aBezEnd=rP2;
- bBezier=bRet;
+ bBezier=true;
}
XPolygon ImpPathCreateUser::GetBezierPoly() const
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index 85ae72dd1f3b..15dddd2e571f 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -395,20 +395,18 @@ void SAL_CALL AccessibleCell::grabFocus()
sal_Int32 SAL_CALL AccessibleCell::getForeground()
{
ThrowIfDisposed ();
- sal_Int32 nColor (0x0ffffffL);
// todo
- return nColor;
+ return sal_Int32(0x0ffffffL);
}
sal_Int32 SAL_CALL AccessibleCell::getBackground()
{
ThrowIfDisposed ();
- sal_Int32 nColor (0L);
// todo
- return nColor;
+ return 0;
}
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index b512aa16a8e8..c6e71154a9a0 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -228,8 +228,8 @@ void SvxLineWidthToolBoxControl::StateChanged(
// Core-Unit handed over to MetricField
// Should not happen in CreateItemWin ()!
- MapUnit eUnit = MapUnit::Map100thMM; // CD!!! GetCoreMetric();
- pFld->SetCoreUnit( eUnit );
+ // CD!!! GetCoreMetric();
+ pFld->SetCoreUnit( MapUnit::Map100thMM );
pFld->Update( static_cast<const XLineWidthItem*>(pState) );
}
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 08c1964c1f37..648c8b0cff7c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3131,8 +3131,7 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols( std::vector<OUString>& rList
rCurrencyTable[0].GetLanguage() ) );
rList.push_back( aString );
- sal_uInt16 nAuto = ( sal_uInt16 )-1;
- rCurrencyList.push_back( nAuto );
+ rCurrencyList.push_back( sal_uInt16(-1) ); // nAuto
if( bFlag )
{
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 6e0d6aaefc89..0446e9ec819b 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -274,11 +274,10 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH ) == SfxItemState::SET)
{
double fDepth = rReq.GetArgs()->GetItem<SvxDoubleItem>(SID_EXTRUSION_DEPTH)->GetValue();
- double fFraction = 0.0;
EnhancedCustomShapeParameterPair aDepthPropPair;
aDepthPropPair.First.Value <<= fDepth;
aDepthPropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aDepthPropPair.Second.Value <<= fFraction;
+ aDepthPropPair.Second.Value <<= 0.0; // fraction
aDepthPropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
css::beans::PropertyValue aPropValue;
diff --git a/svx/source/uitest/sdrobject.cxx b/svx/source/uitest/sdrobject.cxx
index 7852d6a8bec7..f70cb2e3c511 100644
--- a/svx/source/uitest/sdrobject.cxx
+++ b/svx/source/uitest/sdrobject.cxx
@@ -95,8 +95,7 @@ void SdrUIObject::execute(const OUString& rAction,
throw css::uno::RuntimeException("missing parameter FRAC_Y");
double nFracY = itrFracY->second.toDouble();
Fraction aFracY(nFracY);
- bool bRelative = true;
- pObj->Resize(aPos, aFracX, aFracY, bRelative);
+ pObj->Resize(aPos, aFracX, aFracY, true/*bRelative*/);
}
else if (rAction == "CROP")
{
@@ -156,8 +155,7 @@ void SdrUIObject::execute(const OUString& rAction,
else if (rAction == "SHEAR")
{
Point aPos;
- double nAngle = 0;
- pObj->Shear(aPos, nAngle, 0, false);
+ pObj->Shear(aPos, 0.0/*nAngle*/, 0, false);
}
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index d244ce769cec..0ce3530ccd5f 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -197,7 +197,6 @@ uno::Any SAL_CALL ChineseTranslation_UnoDialog::getPropertyValue( const OUString
uno::Any aRet;
bool bDirectionToSimplified = true;
- bool bUseCharacterVariants = false;
bool bTranslateCommonTerms = false;
{
@@ -213,7 +212,7 @@ uno::Any SAL_CALL ChineseTranslation_UnoDialog::getPropertyValue( const OUString
}
else if( rPropertyName == "IsUseCharacterVariants" )
{
- aRet <<= bUseCharacterVariants;
+ aRet <<= false;
}
else if( rPropertyName == "IsTranslateCommonTerms" )
{
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 41ba358aefb1..1fe32e50283f 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -589,10 +589,9 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
// putting the StatusIndicator that we got from the MediaDescriptor into our local FilterData copy
if ( rSettings.mxStatusIndicator.is() )
{
- OUString sStatusIndicator( "StatusIndicator" );
int i = rSettings.maFilterData.getLength();
rSettings.maFilterData.realloc( i + 1 );
- rSettings.maFilterData[ i ].Name = sStatusIndicator;
+ rSettings.maFilterData[ i ].Name = "StatusIndicator";
rSettings.maFilterData[ i ].Value <<= rSettings.mxStatusIndicator;
}
}
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index f28b85a819f4..96184b68e8f1 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -96,9 +96,9 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro
{
try
{
- MapUnit aMapUnit( MapUnit::Map100thMM ); // the API handles with MapUnit::Map100thMM map mode
+ // the API handles with MapUnit::Map100thMM map mode
MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) );
- aTmp = OutputDevice::LogicToLogic( aTmp, aMapUnit, aObjUnit );
+ aTmp = OutputDevice::LogicToLogic( aTmp, MapUnit::Map100thMM, aObjUnit );
xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) );
}
catch( uno::Exception& )
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index a51aa1b641ae..eb18e3394a5f 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -440,9 +440,8 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt
aRet.xStream = aRet.xStorage->openStreamElement( rPictureStreamName, nMode );
if( aRet.xStream.is() && ( SvXMLGraphicHelperMode::Write == meCreateMode ) )
{
- OUString aPropName( "UseCommonStoragePasswordEncryption" );
uno::Reference < beans::XPropertySet > xProps( aRet.xStream, uno::UNO_QUERY );
- xProps->setPropertyValue( aPropName, uno::makeAny( true) );
+ xProps->setPropertyValue( "UseCommonStoragePasswordEncryption", uno::makeAny( true) );
}
}
@@ -478,7 +477,8 @@ OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const OUString& rFileName )
const OString aExt(OUStringToOString(rFileName.copy(rFileName.getLength() - 3),
RTL_TEXTENCODING_ASCII_US));
- for( long i = 0, nCount = SAL_N_ELEMENTS(aMapper); ( i < nCount ) && aMimeType.isEmpty(); ++i )
+ long const nCount = SAL_N_ELEMENTS(aMapper);
+ for( long i = 0; ( i < nCount ) && aMimeType.isEmpty(); ++i )
if( aExt == aMapper[ i ].pExt )
aMimeType = OUString( aMapper[ i ].pMimeType, strlen( aMapper[ i ].pMimeType ), RTL_TEXTENCODING_ASCII_US );
}
@@ -647,9 +647,8 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
if( aObj.GetType() != GraphicType::NONE )
{
maGrfObjs.push_back( aObj );
- OUString aBaseURL( XML_GRAPHICOBJECT_URL_BASE );
- rURLPair.second = aBaseURL;
+ rURLPair.second = XML_GRAPHICOBJECT_URL_BASE;
rURLPair.second += OStringToOUString(aObj.GetUniqueID(),
RTL_TEXTENCODING_ASCII_US);
}