diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-30 12:16:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-31 08:25:07 +0200 |
commit | c9253818ec8252169c20450b41878be459568d95 (patch) | |
tree | 1f271151725042f33c3c8aa3988343bcd7f89e12 /sw | |
parent | 242a796a71e29a1d8cdc4dd71d2465b898db32ab (diff) |
loplugin:oncevar
extend oncevar to any POD type
Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
Reviewed-on: https://gerrit.libreoffice.org/40564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 10 | ||||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmldrawreader.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlfonte.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dbui/selectdbtabledialog.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/srtdlg.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/lingu/hhcwrp.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtsh.cxx | 3 |
19 files changed, 41 insertions, 40 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 370d220e6a74..17afb75359fe 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -2105,7 +2105,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99140, "tdf99140.docx") DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" ) { - sal_Int32 cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; + sal_Int32 const cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); uno::Reference< frame::XModel > xModel( mxComponent, uno::UNO_QUERY ); @@ -2133,7 +2133,7 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" ) // tdf#106742 for DOCX with compatibility level <= 14 (MS Word up to and incl. ver.2010), we should use cell margins when calculating table left border position DECLARE_OOXMLEXPORT_TEST( testTablePosition14, "table-position-14.docx" ) { - sal_Int32 aXCoordsFromOffice[] = { 2500, -1000, 0, 0 }; + sal_Int32 const aXCoordsFromOffice[] = { 2500, -1000, 0, 0 }; uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); uno::Reference< frame::XModel > xModel( mxComponent, uno::UNO_QUERY ); @@ -2157,7 +2157,7 @@ DECLARE_OOXMLEXPORT_TEST( testTablePosition14, "table-position-14.docx" ) // tdf#106742 for DOCX with compatibility level > 14 (MS Word since ver.2013), we should NOT use cell margins when calculating table left border position DECLARE_OOXMLEXPORT_TEST( testTablePosition15, "table-position-15.docx" ) { - sal_Int32 aXCoordsFromOffice[] = { 2751, -899, 1, 106 }; + sal_Int32 const aXCoordsFromOffice[] = { 2751, -899, 1, 106 }; uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY ); uno::Reference< frame::XModel > xModel( mxComponent, uno::UNO_QUERY ); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index b7745e2c659e..9f75068be62f 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -209,21 +209,21 @@ DECLARE_RTFEXPORT_TEST(testCommentsNested, "comments-nested.odt") DECLARE_RTFEXPORT_TEST(testMathAccents, "math-accents.rtf") { OUString aActual = getFormula(getRun(getParagraph(1), 1)); - OUString aExpected("acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a} widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}"); + OUString const aExpected("acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a} widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } DECLARE_RTFEXPORT_TEST(testMathEqarray, "math-eqarray.rtf") { OUString aActual = getFormula(getRun(getParagraph(1), 1)); - OUString aExpected("y = left lbrace stack { 0, x < 0 # 1, x = 0 # {x} ^ {2} , x > 0 } right none"); + OUString const aExpected("y = left lbrace stack { 0, x < 0 # 1, x = 0 # {x} ^ {2} , x > 0 } right none"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } DECLARE_RTFEXPORT_TEST(testMathD, "math-d.rtf") { OUString aActual = getFormula(getRun(getParagraph(1), 1)); - OUString aExpected("left (x mline y mline z right ) left (1 right ) left [2 right ] left ldbracket 3 right rdbracket left lline 4 right rline left ldline 5 right rdline left langle 6 right rangle left langle a mline b right rangle left ({x} over {y} right )"); + OUString const aExpected("left (x mline y mline z right ) left (1 right ) left [2 right ] left ldbracket 3 right rdbracket left lline 4 right rline left ldline 5 right rdline left langle 6 right rangle left langle a mline b right rangle left ({x} over {y} right )"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } @@ -298,7 +298,7 @@ DECLARE_RTFEXPORT_TEST(testMathMso2007, "math-mso2007.rtf") DECLARE_RTFEXPORT_TEST(testMathNary, "math-nary.rtf") { OUString aActual = getFormula(getRun(getParagraph(1), 1)); - OUString aExpected("lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}"); + OUString const aExpected("lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } @@ -338,7 +338,7 @@ DECLARE_RTFEXPORT_TEST(testMathSepchr, "math-sepchr.rtf") DECLARE_RTFEXPORT_TEST(testMathSubscripts, "math-subscripts.rtf") { OUString aActual = getFormula(getRun(getParagraph(1), 1)); - OUString aExpected("{x} ^ {y} + {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} {x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub {2} rsup {1}"); + OUString const aExpected("{x} ^ {y} + {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} {x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub {2} rsup {1}"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 52cab54b2e61..5ea85cc7360b 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -118,8 +118,8 @@ DECLARE_WW8IMPORT_TEST( testTdf105570, "tdf105570.doc" ) DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc") { - sal_Int32 nCellWidths[3][4] = { { 9530, 0, 0, 0 },{ 2382, 2382, 2382, 2384 },{ 2382, 2382, 2382, 2384 } }; - sal_Int32 nCellTxtLns[3][4] = { { 1, 0, 0, 0 },{ 1, 0, 0, 0},{ 1, 1, 1, 1 } }; + sal_Int32 const nCellWidths[3][4] = { { 9530, 0, 0, 0 },{ 2382, 2382, 2382, 2384 },{ 2382, 2382, 2382, 2384 } }; + sal_Int32 const nCellTxtLns[3][4] = { { 1, 0, 0, 0 },{ 1, 0, 0, 0},{ 1, 1, 1, 1 } }; // Table was distorted because of missing sprmPFInnerTableCell at paragraph marks (0x0D) with sprmPFInnerTtp for (sal_Int32 nRow : { 0, 1, 2 }) for (sal_Int32 nCell : { 0, 1, 2, 3 }) diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 4dafcf02ff62..636325f872b5 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -1332,7 +1332,7 @@ void DocumentFieldsManager::SetFixFields( const DateTime* pNewDateTime ) nTime = tools::Time( tools::Time::SYSTEM ).GetTime(); } - SwFieldIds aTypes[5] = { + SwFieldIds const aTypes[] { /*0*/ SwFieldIds::DocInfo, /*1*/ SwFieldIds::Author, /*2*/ SwFieldIds::ExtUser, diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 6ce19ccd6390..42e841b080cd 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -319,7 +319,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, sw::DocumentContentOperationsManager::ParaRstFormat aPara( pStt, pEnd, pHst ); // mst: not including META here; it seems attrs with CH_TXTATR are omitted - sal_uInt16 aResetableSetRange[] = { + sal_uInt16 const aResetableSetRange[] { RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index e65d24c2692b..8b4fb2936fe2 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -3082,7 +3082,7 @@ void sw_BoxSetSplitBoxFormats( SwTableBox* pBox, SwCollectTableLineBoxes* pSplPa } else { - sal_uInt16 aTableSplitBoxSetRange[] = { + sal_uInt16 const aTableSplitBoxSetRange[] { RES_LR_SPACE, RES_UL_SPACE, RES_BACKGROUND, RES_SHADOW, RES_PROTECT, RES_PROTECT, diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 493eb8ea3185..2bca01b9ca08 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -6862,8 +6862,8 @@ static drawinglayer::primitive2d::Primitive2DContainer lcl_CreatePageAreaDelimit double nLineLength = 200.0; // in Twips Point aPoints[] = { rRect.TopLeft(), rRect.TopRight(), rRect.BottomRight(), rRect.BottomLeft() }; - double aXOffDirs[] = { -1.0, 1.0, 1.0, -1.0 }; - double aYOffDirs[] = { -1.0, -1.0, 1.0, 1.0 }; + double const aXOffDirs[] = { -1.0, 1.0, 1.0, -1.0 }; + double const aYOffDirs[] = { -1.0, -1.0, 1.0, 1.0 }; // Actually loop over the corners to create the two lines for ( int i = 0; i < 4; i++ ) @@ -6917,8 +6917,8 @@ static drawinglayer::primitive2d::Primitive2DContainer lcl_CreateColumnAreaDelim double nLineLength = 100.0; // in Twips Point aPoints[] = { rRect.TopLeft(), rRect.TopRight(), rRect.BottomRight(), rRect.BottomLeft() }; - double aXOffDirs[] = { 1.0, -1.0, -1.0, 1.0 }; - double aYOffDirs[] = { 1.0, 1.0, -1.0, -1.0 }; + double const aXOffDirs[] = { 1.0, -1.0, -1.0, 1.0 }; + double const aYOffDirs[] = { 1.0, 1.0, -1.0, -1.0 }; // Actually loop over the corners to create the two lines for ( int i = 0; i < 4; i++ ) diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index 7654a703bdf5..d773d0173646 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -370,10 +370,10 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) eAniDir = SdrTextAniDirection::Right; // re set the attributes needed for scrolling - sal_uInt16 aWhichMap[7] = { XATTR_FILL_FIRST, XATTR_FILL_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - EE_CHAR_START, EE_CHAR_END, - 0 }; + sal_uInt16 const aWhichMap[] { XATTR_FILL_FIRST, XATTR_FILL_LAST, + SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, + EE_CHAR_START, EE_CHAR_END, + 0 }; SfxItemSet aItemSet( pModel->GetItemPool(), aWhichMap ); aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aItemSet.Put( makeSdrTextAutoGrowHeightItem( true ) ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index e20400036e23..f014dfe59ebd 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2553,8 +2553,8 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t m_rWW8Export.InsUInt16( aShd.GetValue() ); } - sal_uInt32 aSprmIds[] = { NS_sprm::sprmTDefTableShd, - NS_sprm::sprmTDefTableShdRaw }; + sal_uInt32 const aSprmIds[] { NS_sprm::sprmTDefTableShd, + NS_sprm::sprmTDefTableShdRaw }; sal_uInt8 nBoxes0 = rTabBoxes.size(); if (nBoxes0 > 21) nBoxes0 = 21; @@ -3253,7 +3253,7 @@ void WW8Export::ExportDocument_Impl() pDataStrm = aTempData.GetStream( StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ); - sal_uInt8 aRC4EncryptionHeader[ 52 ] = {0}; + sal_uInt8 const aRC4EncryptionHeader[ 52 ] = {0}; pTableStrm->WriteBytes(aRC4EncryptionHeader, 52); } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 15d8b4192bef..59395790d65a 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1585,7 +1585,7 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c, rStrm.WriteBytes( aEmptyHeader, nEmptyHdrLen ); // writer fixed header const sal_uInt16 nFixHdrLen = 0x19; - sal_uInt8 aFixHeader[ nFixHdrLen ] = + sal_uInt8 const aFixHeader[ nFixHdrLen ] = { 0x08, 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index e5ed1e137ce3..624a7b26cb8e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -219,10 +219,10 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell* pDocShell, s //sal_uInt8 maGuidStdLink[ 16 ] ={ // 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B }; - sal_uInt8 aGuidUrlMoniker[ 16 ] = { + sal_uInt8 const aGuidUrlMoniker[ 16 ] = { 0xE0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B }; - sal_uInt8 aGuidFileMoniker[ 16 ] = { + sal_uInt8 const aGuidFileMoniker[ 16 ] = { 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }; sal_uInt8 aGuid[16]; diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx index f954394cbb29..0cd7aecd50de 100644 --- a/sw/source/filter/xml/xmlfonte.cxx +++ b/sw/source/filter/xml/xmlfonte.cxx @@ -40,8 +40,8 @@ SwXMLFontAutoStylePool_Impl::SwXMLFontAutoStylePool_Impl( SwXMLExport& _rExport, bool blockFontEmbedding ) : XMLFontAutoStylePool( _rExport, blockFontEmbedding ) { - sal_uInt16 aWhichIds[3] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, - RES_CHRATR_CTL_FONT }; + sal_uInt16 const aWhichIds[3] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, + RES_CHRATR_CTL_FONT }; const SfxItemPool& rPool = _rExport.getDoc()->GetAttrPool(); const SfxPoolItem* pItem; diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index 362ce43259af..385761245168 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -106,7 +106,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent, pHeaderTreeContainer->set_width_request(aSize.Width()); pHeaderTreeContainer->set_height_request(aSize.Height()); m_pTable = VclPtr<SwAddressTable>::Create(*pHeaderTreeContainer); - long aStaticTabs[]= { 2, 0, 0 }; + long const aStaticTabs[]= { 2, 0, 0 }; m_pTable->SetTabs( aStaticTabs ); m_pTable->InsertHeaderItem(1, m_sName ); m_pTable->InsertHeaderItem(2, m_sType ); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 3c8657f07063..80095a2bdc13 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2170,8 +2170,8 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) sal_uInt32 n1; sal_uInt16 n2, n3; sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15; - } aGlbNmIds[4] = { { SO3_SM_CLASSID_60 }, { SO3_SM_CLASSID_50 }, - { SO3_SM_CLASSID_40 }, { SO3_SM_CLASSID_30 } }; + } const aGlbNmIds[] = { { SO3_SM_CLASSID_60 }, { SO3_SM_CLASSID_50 }, + { SO3_SM_CLASSID_40 }, { SO3_SM_CLASSID_30 } }; for (const GlobalNameId & rId : aGlbNmIds) { SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3, diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 1a6e5dd0bb4e..7ee772395282 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -438,7 +438,7 @@ void SwSortDlg::LanguageHdl(ListBox* pLBox) const int nLstBoxCnt = 3; ListBox* aLstArr[ nLstBoxCnt ] = { m_pTypDLB1, m_pTypDLB2, m_pTypDLB3 }; - sal_uInt16* aTypeArr[ nLstBoxCnt ] = { &nType1, &nType2, &nType3 }; + sal_uInt16* const aTypeArr[ nLstBoxCnt ] = { &nType1, &nType2, &nType3 }; OUString aOldStrArr[ nLstBoxCnt ]; for( int n = 0; n < nLstBoxCnt; ++n ) diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index d793e2c43886..65b5cae493d4 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -911,8 +911,10 @@ void SwDocShell::Execute(SfxRequest& rReq) "" }; - const char** pHelpIds = bCreateHtml ? aHTMLHelpIds : aMasterHelpIds; - aDlgHelper.SetControlHelpIds( nControlIds, pHelpIds ); + if (bCreateHtml) + aDlgHelper.SetControlHelpIds( nControlIds, aHTMLHelpIds ); + else + aDlgHelper.SetControlHelpIds( nControlIds, aMasterHelpIds ); uno::Reference < XFilePicker2 > xFP = aDlgHelper.GetFilePicker(); std::shared_ptr<const SfxFilter> pFlt; diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 98323e84b665..27cd912a8d57 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -319,7 +319,7 @@ void SwHHCWrapper::ChangeText_impl( const OUString &rNewText, bool bKeepAttribut if (bKeepAttributes) { // get item set with all relevant attributes - sal_uInt16 aRanges[] = { + sal_uInt16 const aRanges[] { RES_CHRATR_BEGIN, RES_FRMATR_END, 0, 0, 0 }; SfxItemSet aItemSet( m_rWrtShell.GetAttrPool(), aRanges ); @@ -475,7 +475,7 @@ void SwHHCWrapper::ReplaceUnit( OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, "SwHHCWrapper::ReplaceUnit : unexpected target language" ); - sal_uInt16 aRanges[] = { + sal_uInt16 const aRanges[] { RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, 0, 0, 0 }; diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index c6d1b3250e99..d8bb9811fe9a 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -446,7 +446,7 @@ SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot) SetHelpId(HID_PVIEW_ZOOM_LB); SetSizePixel(LogicToPixel(Size(30, 86), MapUnit::MapAppFont)); EnableAutocomplete( false ); - const char* aZoomValues[] = + const char* const aZoomValues[] = { RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 , RID_SVXSTR_ZOOM_75 , RID_SVXSTR_ZOOM_100 , RID_SVXSTR_ZOOM_150 , RID_SVXSTR_ZOOM_200 , diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 1c5bbb245ab3..af34bbf45445 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -295,9 +295,8 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) if (!xMCF.is()) return; - OUString sService("com.sun.star.linguistic2.ChineseTranslationDialog"); Reference<ui::dialogs::XExecutableDialog> xDialog( - xMCF->createInstanceWithContext(sService, xContext), UNO_QUERY); + xMCF->createInstanceWithContext("com.sun.star.linguistic2.ChineseTranslationDialog", xContext), UNO_QUERY); Reference<lang::XInitialization> xInit(xDialog, UNO_QUERY); |