summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 11:12:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 13:06:59 +0200
commite5ece062058f7772f8414d47d07bb8af6e8e5c2a (patch)
tree97ab9340c5e29f5445279a9585b4abe42396b14d /sw/source/filter
parent2d5090419e0113f5b411ee84bfc55926a19da411 (diff)
loplugin:oncevar in sw
Change-Id: Ia96172489eec09607113d388a5b683bb6e0d2dec Reviewed-on: https://gerrit.libreoffice.org/39290 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/basflt/iodetect.cxx4
-rw-r--r--sw/source/filter/html/htmlbas.cxx3
-rw-r--r--sw/source/filter/html/htmlcss1.cxx3
-rw-r--r--sw/source/filter/html/htmlform.cxx3
-rw-r--r--sw/source/filter/html/htmltab.cxx4
-rw-r--r--sw/source/filter/html/svxcss1.cxx4
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx7
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx11
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx11
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx3
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx9
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx5
-rw-r--r--sw/source/filter/xml/xmlexp.cxx3
-rw-r--r--sw/source/filter/xml/xmlimp.cxx3
-rw-r--r--sw/source/filter/xml/xmltexti.cxx15
20 files changed, 42 insertions, 73 deletions
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 32fd3a13048c..862f0165e4c3 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -296,9 +296,9 @@ bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, sal_uLong &rLen,
nNewLen = rLen/2;
memcpy(pNewBuf, pBuf, rLen);
#ifdef OSL_LITENDIAN
- bool bNativeLE = true;
+ bool const bNativeLE = true;
#else
- bool bNativeLE = false;
+ bool const bNativeLE = false;
#endif
if (bLE != bNativeLE)
{
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 372ee9be7078..0bcca0f9b98f 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -272,7 +272,6 @@ void SwHTMLWriter::OutBasic()
for( const auto& pModule: pBasic->GetModules() )
{
OUString sLang(SVX_MACRO_LANGUAGE_STARBASIC);
- ScriptType eType = STARBASIC;
if( bFirst )
{
@@ -294,7 +293,7 @@ void SwHTMLWriter::OutBasic()
const OUString& rModName = pModule->GetName();
Strm().WriteCharPtr( SAL_NEWLINE_STRING ); // don't indent!
HTMLOutFuncs::OutScript( Strm(), GetBaseURL(), pModule->GetSource(),
- sLang, eType, aEmptyOUStr,
+ sLang, STARBASIC, aEmptyOUStr,
&rLibName, &rModName,
m_eDestEnc, &m_aNonConvertableCharacters );
}
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index eb72f91f3bd7..f5dde653a0e7 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2040,7 +2040,6 @@ void SwHTMLParser::SetVarSize( SvxCSS1PropertyInfo &rPropInfo,
SfxItemSet &rFrameItemSet,
SwTwips nDfltWidth, sal_uInt8 nDfltPrcWidth )
{
- SwFrameSize eSize = ATT_MIN_SIZE;
SwTwips nWidth = nDfltWidth, nHeight = MINFLY;
sal_uInt8 nPrcWidth = nDfltPrcWidth, nPrcHeight = 0;
switch( rPropInfo.m_eWidthType )
@@ -2070,7 +2069,7 @@ void SwHTMLParser::SetVarSize( SvxCSS1PropertyInfo &rPropInfo,
;
}
- SwFormatFrameSize aFrameSize( eSize, nWidth, nHeight );
+ SwFormatFrameSize aFrameSize( ATT_MIN_SIZE, nWidth, nHeight );
aFrameSize.SetWidthPercent( nPrcWidth );
aFrameSize.SetHeightPercent( nPrcHeight );
rFrameItemSet.Put( aFrameSize );
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 933da9bddfe2..07f4fa4174e2 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -609,8 +609,7 @@ static void lcl_html_setFixedFontProperty(
aTmp <<= (sal_Int16) aFixedFont.GetPitch();
rPropSet->setPropertyValue("FontPitch", aTmp );
- float fVal(10.);
- aTmp <<= fVal;
+ aTmp <<= float(10.0);
rPropSet->setPropertyValue("FontHeight", aTmp );
}
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 5f5d78fe52a3..e497972a948c 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -1093,8 +1093,6 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo()
(*m_pColumns)[0]->bLeftBorder ? GetBorderWidth(m_aLeftBorderLine, true) : 0;
sal_uInt16 nRightBorderWidth =
m_bRightBorder ? GetBorderWidth( m_aRightBorderLine, true ) : 0;
- sal_uInt16 nInhLeftBorderWidth = 0;
- sal_uInt16 nInhRightBorderWidth = 0;
m_pLayoutInfo = new SwHTMLTableLayout(
m_pSwTable,
@@ -1103,7 +1101,7 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo()
m_nCellSpacing, m_eTableAdjust,
m_nLeftMargin, m_nRightMargin,
nBorderWidth, nLeftBorderWidth, nRightBorderWidth,
- nInhLeftBorderWidth, nInhRightBorderWidth );
+ 0/*nInhLeftBorderWidth*/, 0/*nInhRightBorderWidth*/ );
bool bExportable = true;
sal_uInt16 i;
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index e87fb3ad6adf..eeeeca87c8de 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -1075,8 +1075,6 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr,
OSL_ENSURE( pExpr, "no expression" );
OUString aName, aStyleName;
- FontFamily eFamily = FAMILY_DONTKNOW;
- FontPitch ePitch = PITCH_DONTKNOW;
rtl_TextEncoding eEnc = rParser.GetDfltEncoding();
const FontList *pFList = rParser.GetFontList();
bool bFirst = true;
@@ -1128,7 +1126,7 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr,
if( !aName.isEmpty() && !rParser.IsIgnoreFontFamily() )
{
- SvxFontItem aFont( eFamily, aName, aStyleName, ePitch,
+ SvxFontItem aFont( FAMILY_DONTKNOW, aName, aStyleName, PITCH_DONTKNOW,
eEnc, aItemIds.nFont );
if( rParser.IsSetWesternProps() )
rItemSet.Put( aFont );
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 46691f5fec8b..8c5e7369945a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6799,13 +6799,11 @@ void DocxAttributeOutput::WritePostitFields()
bool DocxAttributeOutput::DropdownField( const SwField* pField )
{
- bool bExpand = false;
-
ww::eField eType = ww::eFORMDROPDOWN;
OUString sCmd = FieldString( eType );
GetExport( ).OutputField( pField, eType, sCmd );
- return bExpand;
+ return false;
}
bool DocxAttributeOutput::PlaceholderField( const SwField* pField )
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index fce28149f983..0503f2a97030 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2068,12 +2068,11 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
const SvxShadowItem* pSI = static_cast<const SvxShadowItem*>(pShadItem);
const sal_uInt16 nCstScale = 635; // unit scale between AOO and MS Word
- const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value.
+ const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value.
sal_uInt32 nColor = (sal_uInt32)(pSI->GetColor().GetColor()) ;
sal_Int32 nOffX = pSI->GetWidth() * nCstScale;
sal_Int32 nOffY = pSI->GetWidth() * nCstScale;
- sal_uInt32 nShadow = nShadowType;
SvxShadowLocation eLocation = pSI->GetLocation();
if( (eLocation!=SvxShadowLocation::NONE) && (pSI->GetWidth()!=0) )
@@ -2102,10 +2101,10 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
break;
}
- rPropOpt.AddOpt( DFF_Prop_shadowColor, wwUtility::RGBToBGR((nColor)));
+ rPropOpt.AddOpt( DFF_Prop_shadowColor, wwUtility::RGBToBGR(nColor));
rPropOpt.AddOpt( DFF_Prop_shadowOffsetX, nOffX );
rPropOpt.AddOpt( DFF_Prop_shadowOffsetY, nOffY );
- rPropOpt.AddOpt( DFF_Prop_fshadowObscured, nShadow );
+ rPropOpt.AddOpt( DFF_Prop_fshadowObscured, nShadowType );
}
}
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 37e38d5c52b4..74a5041ecccc 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -403,9 +403,8 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
//The hard formatting properties that affect the entire paragraph
if (rNd.HasSwAttrSet())
{
- bool bDeep = false;
// only copy hard attributes - bDeep = false
- aExportSet.Set(rNd.GetSwAttrSet(), bDeep);
+ aExportSet.Set(rNd.GetSwAttrSet(), false/*bDeep*/);
// get the current font item. Use rNd.GetSwAttrSet instead of aExportSet:
const SvxFontItem &rNdFont = ItemGet<SvxFontItem>(rNd.GetSwAttrSet(), nFontId);
pFont = &rNdFont;
@@ -2136,7 +2135,6 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
sal_Int32 const nEnd = aStr.getLength();
bool bIncludeEndOfParaCRInRedlineProperties = false;
sal_Int32 nOpenAttrWithRange = 0;
- OUString aStringForImage("\001");
ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner;
if ( pTextNodeInfo.get() != nullptr )
@@ -2168,7 +2166,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
3) If the anchor is associated with a text node with empty text then we ignore.
*/
if( rNode.IsTextNode()
- && aStr != aStringForImage && !aStr.isEmpty()
+ && aStr != "\001" && !aStr.isEmpty()
&& !rNode.GetFlyFormat()
&& !(IsInTable() && !AllowPostponedTextInTable())
&& aAttrIter.IsAnchorLinkedToThisNode(rNode.GetIndex()) )
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index ecb31796f019..43cdb2008d75 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -162,11 +162,11 @@ void WW8AttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule &r
for ( int i = 0; i < WW8ListManager::nMaxLevel; ++i )
SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, 0xFFF );
- sal_uInt8 nFlags = 0, nDummy = 0;
+ sal_uInt8 nFlags = 0;
if ( rRule.IsContinusNum() )
nFlags |= 0x1;
- m_rWW8Export.pTableStrm->WriteUChar( nFlags ).WriteUChar( nDummy );
+ m_rWW8Export.pTableStrm->WriteUChar( nFlags ).WriteUChar( 0/*nDummy*/ );
}
void MSWordExportBase::NumberingDefinitions()
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 7b1a06f741aa..b1a49391b848 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2246,11 +2246,11 @@ void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTab
if (rUL.GetUpper() > 0)
{
- sal_uInt8 nPadding = 2;
- sal_uInt8 nPcVert = 0;
- sal_uInt8 nPcHorz = 0;
+ sal_uInt8 const nPadding = 2;
+ sal_uInt8 const nPcVert = 0;
+ sal_uInt8 const nPcHorz = 0;
- sal_uInt8 nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
+ sal_uInt8 const nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
m_rWW8Export.InsUInt16(NS_sprm::sprmTPc);
m_rWW8Export.pO->push_back( nTPc );
@@ -3321,8 +3321,7 @@ void WW8Export::ExportDocument_Impl()
// Write Unencrypted Header 52 bytes to the start of the table stream
// EncryptionVersionInfo (4 bytes): A Version structure where Version.vMajor MUST be 0x0001, and Version.vMinor MUST be 0x0001.
pTableStrmTemp->Seek( 0 );
- sal_uInt32 nEncType = 0x10001;
- pTableStrmTemp->WriteUInt32( nEncType );
+ pTableStrmTemp->WriteUInt32( 0x10001 ); // nEncType
sal_uInt8 pDocId[16];
aCtx.GetDocId( pDocId );
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index e11013186485..1986429414b2 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -657,7 +657,7 @@ void SwWW8WrGrf::WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rGrfNd,
OUString aFileN;
rGrfNd.GetFileFilterNms( &aFileN, nullptr );
- sal_uInt16 mm = 94; // 94 = BMP, GIF
+ sal_uInt16 const mm = 94; // 94 = BMP, GIF
WritePICFHeader(rStrm, rFly, mm, nWidth, nHeight,
rGrfNd.GetpSwAttrSet());
@@ -679,7 +679,6 @@ void SwWW8WrGrf::WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf,
sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight)
{
sal_Int16 nXSizeAdd = 0, nYSizeAdd = 0;
- sal_Int16 nCropL = 0, nCropR = 0, nCropT = 0, nCropB = 0;
Size aGrTwipSz(rGrf.GetPrefSize());
sal_uInt16 nHdrLen = 0x44;
@@ -754,10 +753,10 @@ void SwWW8WrGrf::WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf,
else
pArr += 2;
- Set_UInt16( pArr, nCropL ); // set dxaCropLeft
- Set_UInt16( pArr, nCropT ); // set dyaCropTop
- Set_UInt16( pArr, nCropR ); // set dxaCropRight
- Set_UInt16( pArr, nCropB ); // set dyaCropBottom
+ Set_UInt16( pArr, 0 ); // set dxaCropLeft
+ Set_UInt16( pArr, 0 ); // set dyaCropTop
+ Set_UInt16( pArr, 0 ); // set dxaCropRight
+ Set_UInt16( pArr, 0 ); // set dyaCropBottom
rStrm.WriteBytes(aArr, nHdrLen);
}
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index da52344e2545..ab83079eebf5 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1946,10 +1946,9 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
// Add a continuous section break
if( GetExport().AddSectionBreaksForTOX() )
{
- sal_uLong nRstLnNum = 0;
SwSection *pParent = rSect.GetParent();
WW8_SepInfo rInfo(&GetExport( ).m_pDoc->GetPageDesc(0),
- pParent ? pParent->GetFormat() : nullptr, nRstLnNum);
+ pParent ? pParent->GetFormat() : nullptr, 0/*nRstLnNum*/);
GetExport( ).AttrOutput().SectionBreak( msword::PageBreak, &rInfo );
}
@@ -2276,8 +2275,7 @@ void AttributeOutputBase::EndTOX( const SwSection& rSect,bool bCareEnd )
if ( 0 < nCol )
{
- sal_uLong nRstLnNum = 0;
- WW8_SepInfo rInfo( &GetExport( ).m_pDoc->GetPageDesc( 0 ), rSect.GetFormat() , nRstLnNum );
+ WW8_SepInfo rInfo( &GetExport( ).m_pDoc->GetPageDesc( 0 ), rSect.GetFormat(), 0/*nRstLnNum*/ );
GetExport( ).AttrOutput().SectionBreak( msword::PageBreak, &rInfo );
}
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9eb7f693b77e..77009b764fed 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1907,8 +1907,7 @@ void SwWW8ImplReader::ImportDop()
{
if (xInfo->hasPropertyByName("ApplyFormDesignMode"))
{
- bool bValue = false;
- xDocProps->setPropertyValue("ApplyFormDesignMode", css::uno::makeAny(bValue));
+ xDocProps->setPropertyValue("ApplyFormDesignMode", css::uno::makeAny(false));
}
}
}
@@ -4869,8 +4868,6 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom,
ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
{
- ErrCode nErrRet = ERRCODE_NONE;
-
m_rDoc.SetDocumentType( SwDoc::DOCTYPE_MSWORD );
if (m_bNewDoc && m_pStg && !pGloss)
{
@@ -5376,7 +5373,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
UpdatePageDescs(m_rDoc, nPageDescOffset);
- return nErrRet;
+ return ERRCODE_NONE;
}
ErrCode SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableStream,
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 19ca8dee7437..18e5ac15c3ab 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -2415,8 +2415,7 @@ bool WW8FormulaListBox::Import(const uno::Reference <
xPropSet->setPropertyValue("HelpText", aTmp );
}
- bool bDropDown(true);
- xPropSet->setPropertyValue("Dropdown", css::uno::makeAny(bDropDown));
+ xPropSet->setPropertyValue("Dropdown", css::uno::makeAny(true));
if (!maListEntries.empty())
{
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 32acea9229c2..53c0550386d6 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -169,7 +169,6 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
// needed if the filterflags say we will convert bookmarks
// to SetExpFields! And this the exception!
- OUString sHex("\\x");
bool bSetAsHex;
bool bAllowCr = SwFltGetFlag(m_nFieldFlags,
SwFltControlStack::ALLOW_FLD_CR);
@@ -206,7 +205,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
if( bSetAsHex )
{
//all Hex-Numbers with \x before
- OUString sTmp( sHex );
+ OUString sTmp( "\\x" );
if( cChar < 0x10 )
sTmp += "0";
sTmp += OUString::number( cChar, 16 );
@@ -1018,7 +1017,6 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
// If none of these special characters is found, the function returns 0.
void SwWW8ImplReader::MakeTagString( OUString& rStr, const OUString& rOrg )
{
- OUString sHex("\\x");
bool bAllowCr = SwFltGetFlag( m_nFieldFlags, SwFltControlStack::TAGS_IN_TEXT )
|| SwFltGetFlag( m_nFieldFlags, SwFltControlStack::ALLOW_FLD_CR );
sal_Unicode cChar;
@@ -1071,7 +1069,7 @@ void SwWW8ImplReader::MakeTagString( OUString& rStr, const OUString& rOrg )
if( bSetAsHex )
{
//all Hex-Numbers with \x before
- OUString sTmp( sHex );
+ OUString sTmp( "\\x" );
if( cChar < 0x10 )
sTmp += "0";
sTmp += OUString::number( cChar, 16 );
@@ -3038,7 +3036,6 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
case TOX_CONTENT:
{
bool bIsHyperlink = false;
- bool bShowPage = true;
// We set SwTOXElement::OutlineLevel only if
// the parameter \o is within 1 to 9
// or the parameter \f exists
@@ -3223,7 +3220,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
{
aPattern.insert(aPattern.begin(), aLinkStart);
}
- else if ( bShowPage )
+ else
{
for (SwFormTokens::iterator aItr = aPattern.begin();aItr!= aPattern.end();++aItr)
{
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index f5752a43481c..d6f02d7bdcec 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -304,8 +304,7 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrameFormat &rFormat, const wwSection &r
aGrid.SetBaseHeight(writer_cast<sal_uInt16>(nLinePitch));
}
- sal_Int32 nRubyHeight = 0;
- aGrid.SetRubyHeight(writer_cast<sal_uInt16>(nRubyHeight));
+ aGrid.SetRubyHeight(0);
rFormat.SetFormatAttr(aGrid);
}
@@ -1431,7 +1430,7 @@ bool SwWW8ImplReader::SetBorder(SvxBoxItem& rBox, const WW8_BRCVer9* pbrc,
{ WW8_BETW, SvxBoxItemLine::BOTTOM }
};
- for( int i = 0, nEnd = 4; i < nEnd; ++i )
+ for( int i = 0; i < 4; ++i )
{
// ungueltige Borders ausfiltern
const WW8_BRCVer9& rB = pbrc[ aIdArr[ i ].first ];
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 6d41045d0b8c..0e2758b6b0fd 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -426,9 +426,8 @@ void SwXMLExport::SetBodyAttributes()
if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() &&
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->GetPageCount() > 1 )
{
- bool bValue = true;
OUStringBuffer sBuffer;
- ::sax::Converter::convertBool(sBuffer, bValue);
+ ::sax::Converter::convertBool(sBuffer, true);
AddAttribute(XML_NAMESPACE_TEXT, XML_USE_SOFT_PAGE_BREAKS,
sBuffer.makeStringAndClear());
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index dba62895d3f7..e12627b4c656 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1259,8 +1259,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if( ! bPrinterIndependentLayout )
{
- sal_Int16 nTmp = document::PrinterIndependentLayout::DISABLED;
- xProps->setPropertyValue( "PrinterIndependentLayout", Any(nTmp) );
+ xProps->setPropertyValue( "PrinterIndependentLayout", Any(sal_Int16(document::PrinterIndependentLayout::DISABLED)) );
}
if( ! bAddExternalLeading )
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 99052561e3db..58a3bd20f4b8 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -269,8 +269,6 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
try
{
// create object with desired ClassId
- sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
- OUString aName("DummyName");
uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({
@@ -278,11 +276,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
}));
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
- aClass, OUString(), xStorage, aName, aObjArgs), uno::UNO_QUERY );
+ aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY );
if ( xObj.is() )
{
//TODO/LATER: is it enough to only set the VisAreaSize?
- lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MapUnit::MapTwip );
+ lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip );
}
if( pTextCursor )
@@ -566,7 +564,6 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
try
{
// create object with desired ClassId
- OUString aName("DummyName");
uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
@@ -587,7 +584,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
uno::Reference < embed::XEmbeddedObject > xObj(
xFactory->createInstanceLink(
- xStorage, aName, aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
+ xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
uno::UNO_QUERY_THROW );
{
@@ -700,12 +697,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
try
{
// create object with desired ClassId
- OUString aName("DummyName");
uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
- aClass, OUString(), xStorage, aName,
+ aClass, OUString(), xStorage, "DummyName",
uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
// set size to the object
@@ -833,12 +829,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
try
{
// create object with desired ClassId
- OUString aName("DummyName");
uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
uno::Reference < embed::XEmbeddedObject > xObj =
uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew(
- aClass, OUString(), xStorage, aName,
+ aClass, OUString(), xStorage, "DummyName",
uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
// set size to the object