summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-30 12:16:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-31 08:25:07 +0200
commitc9253818ec8252169c20450b41878be459568d95 (patch)
tree1f271151725042f33c3c8aa3988343bcd7f89e12
parent242a796a71e29a1d8cdc4dd71d2465b898db32ab (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>
-rw-r--r--basctl/source/basicide/doceventnotifier.cxx4
-rw-r--r--basctl/source/basicide/moduldl2.cxx6
-rw-r--r--basic/source/uno/namecont.cxx21
-rw-r--r--chart2/qa/extras/chart2export.cxx4
-rw-r--r--chart2/qa/extras/chart2import.cxx2
-rw-r--r--chart2/source/view/main/GL3DRenderer.cxx18
-rw-r--r--chart2/source/view/main/OpenGLRender.cxx52
-rw-r--r--codemaker/source/cppumaker/cppuoptions.cxx9
-rw-r--r--comphelper/source/misc/storagehelper.cxx2
-rw-r--r--compilerplugins/clang/oncevar.cxx23
-rw-r--r--compilerplugins/clang/test/oncevar.cxx6
-rw-r--r--cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx4
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx2
-rw-r--r--cui/source/options/certpath.cxx4
-rw-r--r--cui/source/options/optjava.cxx2
-rw-r--r--cui/source/options/webconninfo.cxx2
-rw-r--r--cui/source/tabpages/border.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx2
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx8
-rw-r--r--editeng/source/editeng/eertfpar.cxx2
-rw-r--r--editeng/source/items/frmitems.cxx4
-rw-r--r--embeddedobj/source/msole/ownview.cxx4
-rw-r--r--extensions/source/bibliography/datman.cxx3
-rw-r--r--extensions/source/propctrlr/eformshelper.cxx16
-rw-r--r--extensions/source/scanner/sane.cxx2
-rw-r--r--forms/source/misc/limitedformats.cxx3
-rw-r--r--framework/source/fwe/xml/xmlnamespaces.cxx12
-rw-r--r--framework/source/services/substitutepathvars.cxx3
-rw-r--r--io/source/acceptor/acc_socket.cxx8
-rw-r--r--io/source/connector/ctr_socket.cxx8
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx6
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx3
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx4
-rw-r--r--jvmfwk/source/fwkbase.cxx8
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx2
-rw-r--r--linguistic/source/lngsvcmgr.cxx6
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpsilverbullet.cxx6
-rw-r--r--mysqlc/source/mysqlc_databasemetadata.cxx4
-rw-r--r--o3tl/qa/test-array_view.cxx6
-rw-r--r--oox/source/drawingml/misccontexts.cxx2
-rw-r--r--oox/source/vml/vmldrawing.cxx2
-rw-r--r--opencl/source/opencl_device.cxx2
-rw-r--r--package/source/manifest/ManifestExport.cxx3
-rw-r--r--sc/qa/unit/filters-test.cxx8
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx4
-rw-r--r--sc/qa/unit/ucalc_formula.cxx2
-rw-r--r--sc/qa/unit/ucalc_pivottable.cxx2
-rw-r--r--sc/qa/unit/ucalc_sort.cxx2
-rw-r--r--sc/source/core/data/conditio.cxx2
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx8
-rw-r--r--sc/source/core/tool/typedstrdata.cxx9
-rw-r--r--sc/source/filter/xml/xmlfonte.cxx12
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx3
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx3
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx5
-rw-r--r--scripting/source/provider/ActiveMSPList.cxx3
-rw-r--r--scripting/source/provider/ProviderCache.cxx10
-rw-r--r--scripting/source/stringresource/stringresource.cxx27
-rw-r--r--sd/source/core/sdpage.cxx3
-rw-r--r--sd/source/core/stlsheet.cxx18
-rw-r--r--sd/source/filter/ppt/pptin.cxx9
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx3
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx2
-rw-r--r--sdext/source/minimizer/optimizerdialog.cxx2
-rw-r--r--sdext/source/presenter/PresenterSlideShowView.cxx2
-rw-r--r--sfx2/source/appl/newhelp.cxx2
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx2
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx2
-rw-r--r--starmath/source/mathmlexport.cxx6
-rw-r--r--svl/qa/unit/items/test_itempool.cxx2
-rw-r--r--svl/source/numbers/zforlist.cxx2
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx2
-rw-r--r--svx/source/accessibility/svxrectctaccessiblecontext.cxx4
-rw-r--r--svx/source/dialog/srchdlg.cxx5
-rw-r--r--svx/source/gallery2/galobj.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx6
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx10
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx4
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx8
-rw-r--r--sw/source/filter/html/htmldrawreader.cxx8
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx6
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx4
-rw-r--r--sw/source/filter/xml/xmlfonte.cxx4
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx4
-rw-r--r--sw/source/ui/misc/srtdlg.cxx2
-rw-r--r--sw/source/uibase/app/docsh2.cxx6
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx4
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx2
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx3
-rw-r--r--test/source/sheet/xcellrangesquery.cxx2
-rw-r--r--tools/source/generic/config.cxx4
-rw-r--r--ucb/qa/cppunit/webdav/webdav_local_neon.cxx3
-rw-r--r--unotools/source/config/lingucfg.cxx8
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx27
-rw-r--r--unotools/source/misc/fontdefs.cxx2
-rw-r--r--vcl/opengl/gdiimpl.cxx4
-rw-r--r--vcl/opengl/x11/gdiimpl.cxx2
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx2
-rw-r--r--vcl/source/filter/ixpm/xpmread.cxx2
-rw-r--r--vcl/source/font/fontcache.cxx3
-rw-r--r--vcl/source/fontsubset/sft.cxx2
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx4
-rw-r--r--vcl/source/window/debugevent.cxx2
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx5
-rw-r--r--vcl/workben/vcldemo.cxx14
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx4
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx4
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx12
-rw-r--r--writerfilter/source/rtftok/rtfdispatchsymbol.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx2
122 files changed, 305 insertions, 371 deletions
diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx
index 90e55e00ee18..66b44fcba789 100644
--- a/basctl/source/basicide/doceventnotifier.cxx
+++ b/basctl/source/basicide/doceventnotifier.cxx
@@ -133,7 +133,7 @@ namespace basctl
const sal_Char* pEventName;
void (DocumentEventListener::*listenerMethod)( const ScriptDocument& _rDocument );
};
- EventEntry aEvents[] = {
+ EventEntry const aEvents[] = {
{ "OnNew", &DocumentEventListener::onDocumentCreated },
{ "OnLoad", &DocumentEventListener::onDocumentOpened },
{ "OnSave", &DocumentEventListener::onDocumentSave },
@@ -145,7 +145,7 @@ namespace basctl
{ "OnModeChanged", &DocumentEventListener::onDocumentModeChanged }
};
- for (EventEntry & aEvent : aEvents)
+ for (EventEntry const & aEvent : aEvents)
{
if ( !_rEvent.EventName.equalsAscii( aEvent.pEventName ) )
continue;
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 778c38e5e96c..fd78b185e7eb 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -149,8 +149,8 @@ CheckBox::CheckBox(vcl::Window* pParent, WinBits nStyle)
, eMode(ObjectMode::Module)
, m_aDocument(ScriptDocument::getApplicationScriptDocument())
{
- long aTabs_[] = { 1, 12 }; // TabPos needs at least one...
- // 12 because of the CheckBox
+ long const aTabs_[] = { 1, 12 }; // TabPos needs at least one...
+ // 12 because of the CheckBox
SetTabs( aTabs_ );
Init();
}
@@ -499,7 +499,7 @@ LibPage::LibPage(vcl::Window * pParent)
m_pLibBox->EnableInplaceEditing(true);
m_pLibBox->SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
- long aTabs[] = { 2, 30, 120 };
+ long const aTabs[] = { 2, 30, 120 };
m_pLibBox->SetTabs( aTabs, MapUnit::MapPixel );
FillListBox();
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 5c8f0c29dda2..64de45125e2b 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1098,11 +1098,6 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
mxSFI->move( aFolderUserBasic, aPrevFolder );
mxSFI->move( aFolderTmp, aFolderUserBasic );
- OUString aUserSearchStr("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE");
- OUString aSharedSearchStr("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE");
- OUString const aBundledSearchStr("vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
- OUString const aInstSearchStr("$(INST)");
-
Sequence< OUString > aNames = pPrevCont->getElementNames();
const OUString* pNames = aNames.getConstArray();
sal_Int32 nNameCount = aNames.getLength();
@@ -1129,10 +1124,10 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
{
OUString aStorageURL = pImplLib->maUnexpandedStorageURL;
bool bCreateLink = true;
- if( aStorageURL.indexOf( aUserSearchStr ) != -1 ||
- aStorageURL.indexOf( aSharedSearchStr ) != -1 ||
- aStorageURL.indexOf( aBundledSearchStr ) != -1 ||
- aStorageURL.indexOf( aInstSearchStr ) != -1 )
+ if( aStorageURL.indexOf( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" ) != -1 ||
+ aStorageURL.indexOf( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" ) != -1 ||
+ aStorageURL.indexOf( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" ) != -1 ||
+ aStorageURL.indexOf( "$(INST)" ) != -1 )
{
bCreateLink = false;
}
@@ -2207,14 +2202,12 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink
maNameContainer->insertByName( Name, aElement );
maModifiable.setModified( true );
- OUString aUserSearchStr("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE");
- OUString aSharedSearchStr("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE");
- OUString const aBundledSearchStr("vnd.sun.star.expand:$BUNDLED_EXTENSIONS");
- if( StorageURL.indexOf( aUserSearchStr ) != -1 )
+ if( StorageURL.indexOf( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" ) != -1 )
{
pNewLib->mbExtension = true;
}
- else if( StorageURL.indexOf( aSharedSearchStr ) != -1 || StorageURL.indexOf( aBundledSearchStr ) != -1 )
+ else if( StorageURL.indexOf( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" ) != -1
+ || StorageURL.indexOf( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" ) != -1 )
{
pNewLib->mbExtension = true;
pNewLib->mbReadOnly = true;
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 11f37235835b..d9050f858c2c 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -596,7 +596,7 @@ void Chart2ExportTest::testEmbeddingsGrabBag()
xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool bEmbeddings = false;
- const char* testEmbeddedFileNames[3] = {"word/embeddings/Microsoft_Excel_Worksheet3.xlsx",
+ const char* const testEmbeddedFileNames[] {"word/embeddings/Microsoft_Excel_Worksheet3.xlsx",
"word/embeddings/Microsoft_Excel_Worksheet2.xlsx",
"word/embeddings/Microsoft_Excel_Worksheet1.xlsx"};
for(int i = 0; i < aGrabBag.getLength(); ++i)
@@ -1121,7 +1121,7 @@ void Chart2ExportTest::testEmbeddingsOleObjectGrabBag()
xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty
bool bEmbeddings = false;
- const char* testEmbeddedFileNames[1] = {"word/embeddings/oleObject1.bin"};
+ const char* const testEmbeddedFileNames[] = {"word/embeddings/oleObject1.bin"};
for(int i = 0; i < aGrabBag.getLength(); ++i)
{
if (aGrabBag[i].Name == "OOXEmbeddings")
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 2399cf7f5034..e81a6e4d347d 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -268,7 +268,7 @@ void Chart2ImportTest::testErrorBarFormatting()
void Chart2ImportTest::testSteppedLines()
{
const sal_Int32 MAXSHEET = 14;
- chart2::CurveStyle curveStyle[] = {
+ chart2::CurveStyle const curveStyle[] = {
chart2::CurveStyle_LINES,
chart2::CurveStyle_CUBIC_SPLINES,
chart2::CurveStyle_B_SPLINES,
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 3ff7939aba2f..5ab1f6b73d44 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -840,9 +840,9 @@ void OpenGL3DRenderer::RenderLine3D(const Polygon3DInfo& polygon)
{
CHECK_GL_ERROR();
glUseProgram(maResources.m_CommonProID);
- PosVecf3 trans = {0.0f, 0, 0.0};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+ PosVecf3 const trans = {0.0f, 0, 0.0};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
MoveModelf(trans, angle, scale);
m_Model = m_GlobalScaleMatrix * m_Model;
m_3DMVP = m_3DProjection * m_3DView * m_Model;
@@ -959,9 +959,9 @@ void OpenGL3DRenderer::RenderPolygon3D(const Polygon3DInfo& polygon)
//move the circle to the pos, and scale using the xScale and Y scale
Vertices3D *pointList = polygon.verticesList[i];
Normals3D *normalList = polygon.normalsList[i];
- PosVecf3 trans = {0.0f, 0.0f, 0.0};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+ PosVecf3 const trans = {0.0f, 0.0f, 0.0};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
MoveModelf(trans, angle, scale);
m_Model = m_GlobalScaleMatrix * m_Model;
glm::mat3 normalMatrix(m_Model);
@@ -2059,9 +2059,9 @@ void OpenGL3DRenderer::RenderTextShape()
CHECK_GL_ERROR();
for (TextInfo & textInfo : m_TextInfoList)
{
- PosVecf3 trans = {0, 0, 0};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1.0, 1.0, 1.0f};
+ PosVecf3 const trans = {0, 0, 0};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1.0, 1.0, 1.0f};
MoveModelf(trans, angle, scale);
m_Model = m_GlobalScaleMatrix * m_Model;
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index c3a2c489efb5..42e716496f1c 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -159,8 +159,8 @@ int OpenGLRender::InitOpenGL()
glBindBuffer(GL_ARRAY_BUFFER, 0);
glEnable(GL_LIGHTING);
- GLfloat light_direction[] = { 0.0 , 0.0 , 1.0 };
- GLfloat materialDiffuse[] = { 1.0 , 1.0 , 1.0 , 1.0};
+ GLfloat const light_direction[] = { 0.0 , 0.0 , 1.0 };
+ GLfloat const materialDiffuse[] = { 1.0 , 1.0 , 1.0 , 1.0};
glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, light_direction);
glMaterialfv(GL_FRONT,GL_DIFFUSE,materialDiffuse);
glEnable(GL_LIGHT0);
@@ -192,9 +192,9 @@ int OpenGLRender::RenderLine2FBO()
CHECK_GL_ERROR();
glLineWidth(m_fLineWidth);
size_t listNum = m_Line2DShapePointList.size();
- PosVecf3 trans = {0.0f, 0.0f, 0.0f};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+ PosVecf3 const trans = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
for (size_t i = 0; i < listNum; i++)
@@ -421,9 +421,9 @@ int OpenGLRender::RenderBubble2FBO()
{
//move the circle to the pos, and scale using the xScale and Y scale
Bubble2DPointList &pointList = m_Bubble2DShapePointList.front();
- PosVecf3 trans = {pointList.x, pointList.y, m_fZStep};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {pointList.xScale / 2, pointList.yScale / 2 , 1.0f};
+ PosVecf3 const trans = {pointList.x, pointList.y, m_fZStep};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {pointList.xScale / 2, pointList.yScale / 2 , 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
//render to fbo
@@ -520,9 +520,9 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
//move the circle to the pos, and scale using the xScale and Y scale
RectanglePointList &pointList = m_RectangleShapePointList.front();
{
- PosVecf3 trans = {0, 0, 0};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1, 1, 1.0f};
+ PosVecf3 const trans = {0, 0, 0};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1, 1, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
}
@@ -570,9 +570,9 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
{
if(bFill)
{
- PosVecf3 trans = {0.0, 0.0, Z_STEP };
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1, 1, 1.0f};
+ PosVecf3 const trans = {0.0, 0.0, Z_STEP };
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1, 1, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
@@ -704,9 +704,9 @@ int OpenGLRender::RenderTextShape()
for (size_t i = 0; i < listNum; i++)
{
TextInfo &textInfo = m_TextInfoList.front();
- PosVecf3 trans = { textInfo.nDx, textInfo.nDy, 0};
- PosVecf3 angle = {0.0f, 0.0f, float(textInfo.rotation)};
- PosVecf3 scale = {1.0, 1.0, 1.0f};
+ PosVecf3 const trans = { textInfo.nDx, textInfo.nDy, 0};
+ PosVecf3 const angle = {0.0f, 0.0f, float(textInfo.rotation)};
+ PosVecf3 const scale = {1.0, 1.0, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
@@ -813,9 +813,9 @@ int OpenGLRender::RenderArea2DShape()
glDisable(GL_MULTISAMPLE);
size_t listNum = m_Area2DShapePointList.size();
- PosVecf3 trans = {0.0f, 0.0f, 0.0f};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1.0f, 1.0f, 1.0f};
+ PosVecf3 const trans = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1.0f, 1.0f, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
for (size_t i = 0; i < listNum; ++i)
@@ -945,9 +945,9 @@ void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadiu
int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
{
int listNum = m_PieSegment2DShapePointList.size();
- PosVecf3 trans = {fPosX, fPosY, 0.0f};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {fSize, fSize, 1.0f};
+ PosVecf3 const trans = {fPosX, fPosY, 0.0f};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {fSize, fSize, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
@@ -994,9 +994,9 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, sal_Int32 nSymbol)
glPointSize(20.f);
CHECK_GL_ERROR();
- PosVecf3 trans = {0.0, 0.0, 0.0};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1.0, 1.0, 1.0f};
+ PosVecf3 const trans = {0.0, 0.0, 0.0};
+ PosVecf3 const angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 const scale = {1.0, 1.0, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx
index ea15907cc1e5..d6f31e89aeee 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -149,8 +149,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
if (isValid("-C") || isValid("-CS"))
{
- OString tmp("'-L' could not be combined with '-C' or '-CS' option");
- throw IllegalArgument(tmp);
+ throw IllegalArgument("'-L' could not be combined with '-C' or '-CS' option");
}
m_options["-L"] = OString();
break;
@@ -170,8 +169,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
if (isValid("-L") || isValid("-C"))
{
- OString tmp("'-CS' could not be combined with '-L' or '-C' option");
- throw IllegalArgument(tmp);
+ throw IllegalArgument("'-CS' could not be combined with '-L' or '-C' option");
}
m_options["-CS"] = OString();
break;
@@ -189,8 +187,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
if (isValid("-L") || isValid("-CS"))
{
- OString tmp("'-C' could not be combined with '-L' or '-CS' option");
- throw IllegalArgument(tmp);
+ throw IllegalArgument("'-C' could not be combined with '-L' or '-CS' option");
}
m_options["-C"] = OString();
break;
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index c4cc8178e298..ed55fe219e52 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -378,7 +378,7 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData(
aEncryptionData[nSha1Ind].Name = PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
aEncryptionData[nSha1Ind + 1].Name = PACKAGE_ENCRYPTIONDATA_SHA1MS1252;
- rtl_TextEncoding pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
+ rtl_TextEncoding const pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
for ( sal_Int32 nInd = 0; nInd < 2; nInd++ )
{
diff --git a/compilerplugins/clang/oncevar.cxx b/compilerplugins/clang/oncevar.cxx
index 00ecb1b6003a..052a448b0325 100644
--- a/compilerplugins/clang/oncevar.cxx
+++ b/compilerplugins/clang/oncevar.cxx
@@ -114,6 +114,9 @@ public:
// macros managing to generate to a valid warning
if (fn == SRCDIR "/solenv/bin/concat-deps.c")
return;
+ // TODO bug in the plugin
+ if (fn == SRCDIR "/vcl/unx/generic/app/saldisp.cxx")
+ return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
@@ -220,6 +223,9 @@ public:
if (loplugin::TypeCheck(qt).LvalueReference().NonConst()) {
recordIgnore(expr->getArg(i));
}
+ if (loplugin::TypeCheck(qt).Pointer().NonConst()) {
+ recordIgnore(expr->getArg(i));
+ }
}
}
}
@@ -235,6 +241,9 @@ public:
if (loplugin::TypeCheck(qt).LvalueReference().NonConst()) {
recordIgnore(expr->getArg(i));
}
+ if (loplugin::TypeCheck(qt).Pointer().NonConst()) {
+ recordIgnore(expr->getArg(i));
+ }
}
}
return true;
@@ -321,9 +330,7 @@ bool OnceVar::VisitVarDecl( const VarDecl* varDecl )
return true;
}
auto const tc = loplugin::TypeCheck(varDecl->getType());
- if (!varDecl->getType()->isScalarType()
- && !varDecl->getType()->isBooleanType()
- && !varDecl->getType()->isEnumeralType()
+ if (!varDecl->getType().isCXX11PODType(compiler.getASTContext())
&& !tc.Class("OString").Namespace("rtl").GlobalNamespace()
&& !tc.Class("OUString").Namespace("rtl").GlobalNamespace()
&& !tc.Class("OStringBuffer").Namespace("rtl").GlobalNamespace()
@@ -346,22 +353,14 @@ bool OnceVar::VisitVarDecl( const VarDecl* varDecl )
if (auto e = dyn_cast<ExprWithCleanups>(initExpr)) {
initExpr = e->getSubExpr();
}
- if (auto stringLit = dyn_cast<clang::StringLiteral>(initExpr)) {
+ if (isa<clang::StringLiteral>(initExpr)) {
foundStringLiteral = true;
- // ignore long literals, helps to make the code more legible
- if (stringLit->getLength() > 40) {
- return true;
- }
} else if (auto constructExpr = dyn_cast<CXXConstructExpr>(initExpr)) {
if (constructExpr->getNumArgs() == 0) {
foundStringLiteral = true; // i.e., empty string
} else {
auto stringLit2 = dyn_cast<clang::StringLiteral>(constructExpr->getArg(0));
foundStringLiteral = stringLit2 != nullptr;
- // ignore long literals, helps to make the code more legible
- if (stringLit2 && stringLit2->getLength() > 40) {
- return true;
- }
}
}
if (!foundStringLiteral) {
diff --git a/compilerplugins/clang/test/oncevar.cxx b/compilerplugins/clang/test/oncevar.cxx
index 5e01d1b98a21..c8cc7bc1390d 100644
--- a/compilerplugins/clang/test/oncevar.cxx
+++ b/compilerplugins/clang/test/oncevar.cxx
@@ -24,6 +24,9 @@ template<typename T> void f() {
}
template void f<int>(); // needed for clang-cl
+class Foo;
+void method1(const Foo**);
+
int main() {
/* TODO
int i;
@@ -55,6 +58,9 @@ int main() {
call_ref(s3);
OUString const s4("xxx");
call_value(s4);
+
+ const Foo* pInternalArgs[] = { nullptr };
+ method1(pInternalArgs);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
index a535d3c7283c..9110cc680476 100644
--- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
+++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
@@ -218,7 +218,7 @@ namespace cppu_ifcontainer
void testOMultiTypeInterfaceContainerHelperInt32()
{
- sal_Int32 pTypes[nTests] =
+ sal_Int32 const pTypes[nTests] =
{
0,
-1,
@@ -239,7 +239,7 @@ namespace cppu_ifcontainer
typedef cppu::OMultiTypeInterfaceContainerHelperVar<
char const *, void, rtl::CStringEqual> StrContainer;
- const char *pTypes[nTests] =
+ const char * const pTypes[nTests] =
{
"this_is", "such", "fun", "writing", "unit", "tests", "when", "it", "works", "anyway"
};
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 3803c68731bd..d9fb7043e246 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -488,7 +488,7 @@ IMPL_LINK( SpellDialog, CheckGrammarHdl, Button*, pBox, void )
void SpellDialog::StartSpellOptDlg_Impl()
{
- sal_uInt16 aSpellInfos[] =
+ sal_uInt16 const aSpellInfos[] =
{
SID_ATTR_SPELL,SID_ATTR_SPELL,
SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index f8e6e46026e1..961e02dc93e1 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -238,7 +238,7 @@ void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sIni
// fill the listboxes
// method of field comparison
- const char* aResIds[] = {
+ const char* const aResIds[] = {
RID_STR_SEARCH_ANYWHERE,
RID_STR_SEARCH_BEGINNING,
RID_STR_SEARCH_END,
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 202866e284f9..d41a7e77b8aa 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -57,11 +57,11 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
try
{
- mozilla::MozillaProductType productTypes[3] = {
+ mozilla::MozillaProductType const productTypes[3] = {
mozilla::MozillaProductType_Thunderbird,
mozilla::MozillaProductType_Firefox,
mozilla::MozillaProductType_Mozilla };
- const char* productNames[3] = {
+ const char* const productNames[3] = {
"thunderbird",
"firefox",
"mozilla" };
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 1fc450aa1217..f8345e7b93fb 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -136,7 +136,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
pJavaListContainer->set_height_request(aControlSize.Height());
m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText);
- long aStaticTabs[]= { 4, 0, 0, 0, 0 };
+ long const aStaticTabs[]= { 4, 0, 0, 0, 0 };
m_pJavaList->SvSimpleTable::SetTabs( aStaticTabs );
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index f6b3aa614f80..afa01a2c7a52 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -112,7 +112,7 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
SvSimpleTableContainer *pPasswordsLBContainer = get<SvSimpleTableContainer>("logins");
m_pPasswordsLB = VclPtr<PasswordTable>::Create(*pPasswordsLBContainer, 0);
- long aStaticTabs[]= { 2, 0, 0 };
+ long const aStaticTabs[]= { 2, 0, 0 };
m_pPasswordsLB->SetTabs( aStaticTabs );
m_pPasswordsLB->InsertHeaderItem( 1, get<FixedText>("website")->GetText(),
HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 5dde954380bb..4a49061026c9 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1235,7 +1235,7 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset )
{ svx::FrameBorderType::Left,SvxBoxInfoItemValidFlags::LEFT },
{ svx::FrameBorderType::Right,SvxBoxInfoItemValidFlags::RIGHT },
};
- SvxBoxItemLine eTypes2[] = {
+ SvxBoxItemLine const eTypes2[] = {
SvxBoxItemLine::TOP,
SvxBoxItemLine::BOTTOM,
SvxBoxItemLine::LEFT,
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 4c7fd57ab7d3..ed8f2b0aa045 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1445,7 +1445,7 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
{
::comphelper::NamedValueCollection aOpenCommandArguments( i_rOpenCommandArguments );
- const char* pObjectDescriptorArgs[] =
+ const char* const pObjectDescriptorArgs[] =
{
"RecoveryStorage"
};
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 58aea8beb431..a269f9c639e4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -782,7 +782,7 @@ void DesktopLOKTest::testWriterComments()
// Insert a comment at the beginning of the document and wait till the main
// loop grabs the focus, so characters end up in the annotation window.
- TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+ TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
m_aCommandResultCondition.reset();
pDocument->pClass->postUnoCommand(pDocument, ".uno:InsertAnnotation", nullptr, true);
Scheduler::ProcessEventsToIdle();
@@ -1064,7 +1064,7 @@ void DesktopLOKTest::testContextMenuCalc()
1, 4, 0);
Scheduler::ProcessEventsToIdle();
- TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+ TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
m_aContextMenuCondition.wait(aTimeValue);
CPPUNIT_ASSERT( !m_aContextMenuResult.empty() );
@@ -1174,7 +1174,7 @@ void DesktopLOKTest::testContextMenuWriter()
1, 4, 0);
Scheduler::ProcessEventsToIdle();
- TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+ TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
m_aContextMenuCondition.wait(aTimeValue);
CPPUNIT_ASSERT( !m_aContextMenuResult.empty() );
@@ -1230,7 +1230,7 @@ void DesktopLOKTest::testContextMenuImpress()
1, 4, 0);
Scheduler::ProcessEventsToIdle();
- TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+ TimeValue const aTimeValue = {2 , 0}; // 2 seconds max
m_aContextMenuCondition.wait(aTimeValue);
CPPUNIT_ASSERT( !m_aContextMenuResult.empty() );
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 96dac9e61b63..97b0ce9a38f8 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -318,7 +318,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit();
if (eDestUnit != eSrcUnit)
{
- sal_uInt16 aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL };
+ sal_uInt16 const aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL };
for (unsigned short aFntHeightIem : aFntHeightIems)
{
if (SfxItemState::SET == rSet.GetAttrSet().GetItemState( aFntHeightIem, false, &pItem ))
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 35e5937caca9..ec920d1cdde6 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1877,7 +1877,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
// WTH are the borders and the distances saved in different order?
- SvxBoxItemLine nLines[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT };
+ SvxBoxItemLine const nLines[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT };
for ( sal_Int32 n = 4; n < 9; n++ )
{
sal_Int32 nDist = 0;
@@ -4028,7 +4028,7 @@ sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const
const char* getFrmDirResId(size_t nIndex)
{
- const char* RID_SVXITEMS_FRMDIR[] =
+ const char* const RID_SVXITEMS_FRMDIR[] =
{
RID_SVXITEMS_FRMDIR_HORI_LEFT_TOP,
RID_SVXITEMS_FRMDIR_HORI_RIGHT_TOP,
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index 0ba477264e20..2add5c4f3201 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -412,9 +412,9 @@ void OwnView_Impl::CreateNative()
if ( xNameAccess->hasByName( aSubStreamName ) )
{
- sal_uInt8 aClassID[] =
+ sal_uInt8 const aClassID[] =
{ 0x00, 0x03, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 };
- uno::Sequence< sal_Int8 > aPackageClassID( reinterpret_cast<sal_Int8*>(aClassID), 16 );
+ uno::Sequence< sal_Int8 > aPackageClassID( reinterpret_cast<sal_Int8 const *>(aClassID), 16 );
uno::Reference< io::XStream > xSubStream;
xNameAccess->getByName( aSubStreamName ) >>= xSubStream;
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 9ae2804a36b3..54a00a7462a2 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -1206,8 +1206,7 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString&
xPropSet->setPropertyValue( "Name", makeAny( rName ) );
// set the name of the to-be-created control
- OUString aControlName("com.sun.star.form.control.InteractionGridControl");
- Any aAny; aAny <<= aControlName;
+ Any aAny(OUString("com.sun.star.form.control.InteractionGridControl"));
xPropSet->setPropertyValue( "DefaultControl",aAny );
// the helpURL
diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx
index 0704887e0d1c..54720f479054 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -123,14 +123,14 @@ namespace pcr
OSL_VERIFY( m_xControlModel->getPropertyValue( PROPERTY_CLASSID ) >>= nControlType );
// some lists
- sal_Int16 nNumericCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, 0 };
- sal_Int16 nDateCompatibleTypes[] = { DataTypeClass::DATE, 0 };
- sal_Int16 nTimeCompatibleTypes[] = { DataTypeClass::TIME, 0 };
- sal_Int16 nCheckboxCompatibleTypes[] = { DataTypeClass::BOOLEAN, DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
- sal_Int16 nRadiobuttonCompatibleTypes[] = { DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
- sal_Int16 nFormattedCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, DataTypeClass::DATETIME, DataTypeClass::DATE, DataTypeClass::TIME, 0 };
-
- sal_Int16* pCompatibleTypes = nullptr;
+ sal_Int16 const nNumericCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, 0 };
+ sal_Int16 const nDateCompatibleTypes[] = { DataTypeClass::DATE, 0 };
+ sal_Int16 const nTimeCompatibleTypes[] = { DataTypeClass::TIME, 0 };
+ sal_Int16 const nCheckboxCompatibleTypes[] = { DataTypeClass::BOOLEAN, DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
+ sal_Int16 const nRadiobuttonCompatibleTypes[] = { DataTypeClass::STRING, DataTypeClass::anyURI, 0 };
+ sal_Int16 const nFormattedCompatibleTypes[] = { DataTypeClass::DECIMAL, DataTypeClass::FLOAT, DataTypeClass::DOUBLE, DataTypeClass::DATETIME, DataTypeClass::DATE, DataTypeClass::TIME, 0 };
+
+ sal_Int16 const * pCompatibleTypes = nullptr;
switch ( nControlType )
{
case FormComponentType::SPINBUTTON:
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 976d76aefbe3..db8ef50d186c 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -619,7 +619,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
break;
}
#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
- const char* ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
+ const char* const ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
"SANE_FRAME_RED", "SANE_FRAME_GREEN",
"SANE_FRAME_BLUE", "Unknown !!!" };
fprintf( stderr, "Parameters for frame %d:\n", nStream );
diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx
index 06aa1a3a18d6..1a416c7c3f64 100644
--- a/forms/source/misc/limitedformats.cxx
+++ b/forms/source/misc/limitedformats.cxx
@@ -325,8 +325,7 @@ namespace frm
if (!bFoundIt)
{ // somebody gave us a format which we can't translate
- OUString sMessage ("This control supports only a very limited number of formats.");
- throw IllegalArgumentException(sMessage, nullptr, 2);
+ throw IllegalArgumentException("This control supports only a very limited number of formats.", nullptr, 2);
}
return bModified;
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index a658cf12961e..6909508f78a5 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -60,8 +60,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
else
{
// a xml namespace without name is not allowed (e.g. "xmlns:" )
- OUString aErrorMessage( "A xml namespace without name is not allowed!" );
- throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+ throw SAXException( "A xml namespace without name is not allowed!", Reference< XInterface >(), Any() );
}
}
@@ -69,8 +68,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue
{
// namespace should be reseted - as xml draft states this is only allowed
// for the default namespace - check and throw exception if check fails
- OUString aErrorMessage( "Clearing xml namespace only allowed for default namespace!" );
- throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+ throw SAXException( "Clearing xml namespace only allowed for default namespace!", Reference< XInterface >(), Any() );
}
else
{
@@ -108,8 +106,7 @@ OUString XMLNamespaces::applyNSToAttributeName( const OUString& aName ) const
else
{
// attribute with namespace but without name "namespace:" is not allowed!!
- OUString aErrorMessage( "Attribute has no name only preceding namespace!" );
- throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+ throw SAXException( "Attribute has no name only preceding namespace!", Reference< XInterface >(), Any() );
}
}
@@ -143,8 +140,7 @@ OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const
else
{
// attribute with namespace but without a name is not allowed (e.g. "cfg:" )
- OUString aErrorMessage( "Attribute has no name only preceding namespace!" );
- throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
+ throw SAXException( "Attribute has no name only preceding namespace!", Reference< XInterface >(), Any() );
}
}
else
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index a266af912c8f..ee5fcaffdb64 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -477,8 +477,7 @@ OUString SubstitutePathVariables::impl_substituteVariable( const OUString& rText
// recursion depth reached!
if ( bSubstRequired )
{
- OUString aMsg( "Endless recursion detected. Cannot substitute variables!" );
- throw NoSuchElementException( aMsg, static_cast<cppu::OWeakObject *>(this) );
+ throw NoSuchElementException( "Endless recursion detected. Cannot substitute variables!", static_cast<cppu::OWeakObject *>(this) );
}
else
aResult = rText;
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 6446c5fa14b6..c8e85cd33185 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -206,9 +206,7 @@ namespace io_acceptor {
}
else
{
- OUString message("acc_socket.cxx:SocketConnection::read: error - connection already closed");
-
- IOException ioException(message, static_cast<XConnection *>(this));
+ IOException ioException("acc_socket.cxx:SocketConnection::read: error - connection already closed", static_cast<XConnection *>(this));
Any any;
any <<= ioException;
@@ -240,9 +238,7 @@ namespace io_acceptor {
}
else
{
- OUString message("acc_socket.cxx:SocketConnection::write: error - connection already closed");
-
- IOException ioException(message, static_cast<XConnection *>(this));
+ IOException ioException("acc_socket.cxx:SocketConnection::write: error - connection already closed", static_cast<XConnection *>(this));
Any any;
any <<= ioException;
diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx
index 35f4e80511a7..e5908d6e41ed 100644
--- a/io/source/connector/ctr_socket.cxx
+++ b/io/source/connector/ctr_socket.cxx
@@ -147,9 +147,7 @@ namespace stoc_connector {
}
else
{
- OUString message("ctr_socket.cxx:SocketConnection::read: error - connection already closed");
-
- IOException ioException(message, static_cast<XConnection *>(this));
+ IOException ioException("ctr_socket.cxx:SocketConnection::read: error - connection already closed", static_cast<XConnection *>(this));
Any any;
any <<= ioException;
@@ -181,9 +179,7 @@ namespace stoc_connector {
}
else
{
- OUString message("ctr_socket.cxx:SocketConnection::write: error - connection already closed");
-
- IOException ioException(message, static_cast<XConnection *>(this));
+ IOException ioException("ctr_socket.cxx:SocketConnection::write: error - connection already closed", static_cast<XConnection *>(this));
Any any;
any <<= ioException;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index dee43b6b6d67..4485828a8926 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -103,7 +103,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
OUString const sJavaHomeProperty("java.home");
OUString const sJavaLibraryPathProperty("java.library.path");
OUString const sGNUHomeProperty("gnu.classpath.home.url");
- OUString sAccessProperty("javax.accessibility.assistive_technologies");
+ OUString const sAccessProperty("javax.accessibility.assistive_technologies");
bool bVersion = false;
bool bVendor = false;
@@ -261,8 +261,6 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
char const * const * arLDPaths = getLibraryPaths( & size);
vector<OUString> ld_paths = getVectorFromCharArray(arLDPaths, size);
- char arSep[]= {SAL_PATHSEPARATOR, 0};
- OUString sPathSep= OUString::createFromAscii(arSep);
bool bLdPath = true;
int c = 0;
for(i_path il = ld_paths.begin(); il != ld_paths.end(); ++il, ++c)
@@ -274,7 +272,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
{
if(c > 0)
- m_sLD_LIBRARY_PATH+= sPathSep;
+ m_sLD_LIBRARY_PATH+= OUStringLiteral1(SAL_PATHSEPARATOR);
m_sLD_LIBRARY_PATH+= usSysPath;
}
else
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 40ce22e78ea9..457c613f7db6 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -135,8 +135,7 @@ OString getPluginJarPath(
if (osl_getSystemPathFromFileURL(sName.pData, & sPath2.pData)
== osl_File_E_None)
{
- char sep[] = {SAL_PATHSEPARATOR, 0};
- sPath = sPath1 + OUString::createFromAscii(sep) + sPath2;
+ sPath = sPath1 + OUStringLiteral1(SAL_PATHSEPARATOR) + sPath2;
}
}
OSL_ASSERT(!sPath.isEmpty());
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 1f7423045bc1..b3e5a4c43de2 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -153,8 +153,6 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
char const * const * arLDPaths = getLibraryPaths( & size);
vector<OUString> ld_paths = getVectorFromCharArray(arLDPaths, size);
- char arSep[]= {SAL_PATHSEPARATOR, 0};
- OUString sPathSep= OUString::createFromAscii(arSep);
bool bLdPath = true;
int c = 0;
for(i_path il = ld_paths.begin(); il != ld_paths.end(); ++il, ++c)
@@ -166,7 +164,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
{
if(c > 0)
- m_sLD_LIBRARY_PATH+= sPathSep;
+ m_sLD_LIBRARY_PATH+= OUStringLiteral1(SAL_PATHSEPARATOR);
m_sLD_LIBRARY_PATH+= usSysPath;
}
else
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 2c24017f1846..155e07c813da 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -88,8 +88,6 @@ OUString getParamFirstUrl(OUString const & name)
VendorSettings::VendorSettings():
m_xmlDocVendorSettingsFileUrl(BootParams::getVendorSettings())
{
- OString sMsgExc("[Java framework] Error in constructor "
- "VendorSettings::VendorSettings() (fwkbase.cxx)");
//Prepare the xml document and context
OString sSettingsPath = getVendorSettingsPath(m_xmlDocVendorSettingsFileUrl);
if (sSettingsPath.isEmpty())
@@ -113,7 +111,8 @@ VendorSettings::VendorSettings():
m_xmlPathContextVendorSettings, reinterpret_cast<xmlChar const *>("jf"),
reinterpret_cast<xmlChar const *>(NS_JAVA_FRAMEWORK));
if (res == -1)
- throw FrameworkException(JFW_E_ERROR, sMsgExc);
+ throw FrameworkException(JFW_E_ERROR,
+ "[Java framework] Error in constructor VendorSettings::VendorSettings() (fwkbase.cxx)");
}
}
@@ -480,8 +479,7 @@ OString makeClassPathOption(OUString const & sUserClassPath)
{
if (!sUserClassPath.isEmpty())
{
- char szSep[] = {SAL_PATHSEPARATOR,0};
- sBufCP.appendAscii(szSep);
+ sBufCP.append(SAL_PATHSEPARATOR);
}
sBufCP.append(sAppCP);
}
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 88cf455e728c..37932525596c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1832,7 +1832,7 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
if (!isEmptyRectangle(priv->m_aGraphicSelection))
{
- GdkRGBA aBlack{0, 0, 0, 0};
+ GdkRGBA const aBlack{0, 0, 0, 0};
renderGraphicHandle(pDocView, pCairo, priv->m_aGraphicSelection, aBlack);
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 1f62ca871a81..7ee052b1ba64 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -673,9 +673,9 @@ void LngSvcMgr::UpdateAll()
SvtLinguConfig aCfg;
const int nNumServices = 4;
- const sal_Char * apServices[nNumServices] = { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS };
- const sal_Char * apCurLists[nNumServices] = { "ServiceManager/SpellCheckerList", "ServiceManager/GrammarCheckerList", "ServiceManager/HyphenatorList", "ServiceManager/ThesaurusList" };
- const sal_Char * apLastFoundLists[nNumServices] = { "ServiceManager/LastFoundSpellCheckers", "ServiceManager/LastFoundGrammarCheckers", "ServiceManager/LastFoundHyphenators", "ServiceManager/LastFoundThesauri" };
+ const sal_Char * const apServices[nNumServices] = { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS };
+ const sal_Char * const apCurLists[nNumServices] = { "ServiceManager/SpellCheckerList", "ServiceManager/GrammarCheckerList", "ServiceManager/HyphenatorList", "ServiceManager/ThesaurusList" };
+ const sal_Char * const apLastFoundLists[nNumServices] = { "ServiceManager/LastFoundSpellCheckers", "ServiceManager/LastFoundGrammarCheckers", "ServiceManager/LastFoundHyphenators", "ServiceManager/LastFoundThesauri" };
// usage of indices as above: 0 = spell checker, 1 = grammar checker, 2 = hyphenator, 3 = thesaurus
std::vector< list_entry_map_t > aLastFoundSvcs(nNumServices);
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 8d157ddfb291..651cf2e1ee4d 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -814,10 +814,10 @@ XFBorders* LwpMiddleLayout::GetXFBorders()
//copy from lwpparastyle.
XFBorders *pXFBorders = new XFBorders();
// apply 4 borders respectively
- LwpBorderStuff::BorderType pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
+ LwpBorderStuff::BorderType const pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
LwpBorderStuff::TOP, LwpBorderStuff::BOTTOM };
- for (LwpBorderStuff::BorderType & nC : pType)
+ for (LwpBorderStuff::BorderType nC : pType)
{
if (pBorderStuff->HasSide(nC))
{
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index 9110c45cd3c9..b84eec40b62a 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -281,19 +281,19 @@ OUString LwpSilverBullet::GetNumCharByStyleID(LwpFribParaNumber* pParaNumber)
break;
case NUMCHAR_Chinese1:
{
- sal_Unicode sBuf[13] = {0x58f9,0x002c,0x0020,0x8d30,0x002c,0x0020,0x53c1,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
+ sal_Unicode const sBuf[13] = {0x58f9,0x002c,0x0020,0x8d30,0x002c,0x0020,0x53c1,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
strNumChar = OUString(sBuf);
}
break;
case NUMCHAR_Chinese2:
{
- sal_Unicode sBuf[13] = {0x4e00,0x002c,0x0020,0x4e8c,0x002c,0x0020,0x4e09,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
+ sal_Unicode const sBuf[13] = {0x4e00,0x002c,0x0020,0x4e8c,0x002c,0x0020,0x4e09,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
strNumChar = OUString(sBuf);
}
break;
case NUMCHAR_Chinese3:
{
- sal_Unicode sBuf[13] = {0x7532,0x002c,0x0020,0x4e59,0x002c,0x0020,0x4e19,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
+ sal_Unicode const sBuf[13] = {0x7532,0x002c,0x0020,0x4e59,0x002c,0x0020,0x4e19,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
strNumChar = OUString(sBuf);
}
break;
diff --git a/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx
index 366b74a8e0d7..68dad0cbcf84 100644
--- a/mysqlc/source/mysqlc_databasemetadata.cxx
+++ b/mysqlc/source/mysqlc_databasemetadata.cxx
@@ -878,8 +878,8 @@ Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection()
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes()
{
- const char * table_types[] = {"TABLE", "VIEW"};
- sal_Int32 requiredVersion[] = {0, 50000};
+ const char * const table_types[] = {"TABLE", "VIEW"};
+ sal_Int32 const requiredVersion[] = {0, 50000};
Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance("org.openoffice.comp.helper.DatabaseMetaDataResultSet"),UNO_QUERY);
std::vector< std::vector< Any > > rRows;
diff --git a/o3tl/qa/test-array_view.cxx b/o3tl/qa/test-array_view.cxx
index 3a19c093304a..ab97d7de49c5 100644
--- a/o3tl/qa/test-array_view.cxx
+++ b/o3tl/qa/test-array_view.cxx
@@ -27,7 +27,7 @@ private:
void testOperations() {
- int some_data[] { 1, 2, 3 };
+ int const some_data[] { 1, 2, 3 };
o3tl::array_view<int> v(some_data);
CPPUNIT_ASSERT_EQUAL(1, *v.begin());
@@ -61,8 +61,8 @@ private:
CPPUNIT_ASSERT_EQUAL(3, v.back());
CPPUNIT_ASSERT_EQUAL(1, *v.data());
{
- int d1[] { 1, 2 };
- int d2[] { 3, 4, 5, 6 };
+ int const d1[] { 1, 2 };
+ int const d2[] { 3, 4, 5, 6 };
o3tl::array_view<int> v1( d1 );
o3tl::array_view<int> v2( d2 );
v1.swap(v2);
diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx
index f5dc16d19b05..431db06e6e8e 100644
--- a/oox/source/drawingml/misccontexts.cxx
+++ b/oox/source/drawingml/misccontexts.cxx
@@ -359,7 +359,7 @@ ContextHandlerRef ArtisticEffectContext::onCreateContext(
return nullptr;
// effect attributes
- sal_Int32 aAttribs[19] = {
+ sal_Int32 const aAttribs[19] = {
XML_visible, XML_trans, XML_crackSpacing, XML_pressure, XML_numberOfShades,
XML_grainSize, XML_intensity, XML_smoothness, XML_gridSize, XML_pencilSize,
XML_size, XML_brushSize, XML_scaling, XML_detail, XML_bright, XML_contrast,
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index e7d172d63dc1..34d798b62d10 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -54,7 +54,7 @@ namespace {
OUString lclGetShapeId( sal_Int32 nShapeId )
{
// identifier consists of a literal NUL character, a lowercase 's', and the id
- sal_Unicode aStr[2] = { '\0', 's' };
+ sal_Unicode const aStr[2] = { '\0', 's' };
return OUString( aStr, 2 ) + OUString::number( nShapeId );
}
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index 62f77c27f1b9..695c85505201 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -312,7 +312,7 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOffice
clStatus = clSetKernelArg(clKernel, 4, sizeof(cl_mem), static_cast<void*>(&clInput3));
DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clSetKernelArg::clInput3");
size_t globalWS[1] = { testData->outputSize };
- size_t localSize[1] = { 64 };
+ size_t const localSize[1] = { 64 };
clStatus = clEnqueueNDRangeKernel(clQueue, clKernel, 1, nullptr, globalWS, localSize, 0, nullptr, nullptr);
DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clEnqueueNDRangeKernel");
clFinish(clQueue);
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 915c8f243bd7..f3ee450594ba 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -187,8 +187,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
uno::Reference < xml::sax::XExtendedDocumentHandler > xExtHandler ( xHandler, uno::UNO_QUERY );
if ( xExtHandler.is() && bProvideDTD )
{
- OUString aDocType ( MANIFEST_DOCTYPE );
- xExtHandler->unknown ( aDocType );
+ xExtHandler->unknown ( MANIFEST_DOCTYPE );
xHandler->ignorableWhitespace ( sWhiteSpace );
}
xHandler->startElement( sManifestElement, xRootAttrList );
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 5b7195302d50..108c1c36029c 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -708,14 +708,14 @@ void ScFiltersTest::testSortWithSheetExternalReferencesODS_Impl( ScDocShellRef c
// Check the original data is there.
for (SCROW nRow=nRow1+1; nRow <= nRow2; ++nRow)
{
- double aCheck[] = { 1, 2, 3, 4, 5 };
+ double const aCheck[] = { 1, 2, 3, 4, 5 };
CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(0,nRow,0)));
}
for (SCROW nRow=nRow1+1; nRow <= nRow2; ++nRow)
{
for (SCCOL nCol=1; nCol <= 3; ++nCol)
{
- double aCheck[] = { 1, 12, 123, 1234, 12345 };
+ double const aCheck[] = { 1, 12, 123, 1234, 12345 };
CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(nCol,nRow,0)));
}
}
@@ -745,7 +745,7 @@ void ScFiltersTest::testSortWithSheetExternalReferencesODS_Impl( ScDocShellRef c
// adjusted to point to the original location.
for (SCROW nRow=nRow1+1; nRow <= nRow2; ++nRow)
{
- double aCheck[] = { 5, 4, 3, 2, 1 };
+ double const aCheck[] = { 5, 4, 3, 2, 1 };
CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(0,nRow,0)));
}
// The last column (D) are in-sheet relative references.
@@ -754,7 +754,7 @@ void ScFiltersTest::testSortWithSheetExternalReferencesODS_Impl( ScDocShellRef c
{
for (SCCOL nCol=1; nCol <= nEndCol; ++nCol)
{
- double aCheck[] = { 12345, 1234, 123, 12, 1 };
+ double const aCheck[] = { 12345, 1234, 123, 12, 1 };
CPPUNIT_ASSERT_EQUAL( aCheck[nRow-nRow1-1], rDoc.GetValue( ScAddress(nCol,nRow,0)));
}
}
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 5a6610c72f60..8823ece151c1 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -2661,7 +2661,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
{
{
// B2:B7 should show A,B,....,F.
- const char* expected[] = { "A", "B", "C", "D", "E", "F" };
+ const char* const expected[] = { "A", "B", "C", "D", "E", "F" };
for (SCROW i = 0; i <= 5; ++i)
{
ScAddress aPos(1,i+1,0);
@@ -2677,7 +2677,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
{
// C2:C7 should show AA,BB,....,FF.
- const char* expected[] = { "AA", "BB", "CC", "DD", "EE", "FF" };
+ const char* const expected[] = { "AA", "BB", "CC", "DD", "EE", "FF" };
for (SCROW i = 0; i <= 5; ++i)
{
ScAddress aPos(2,i+1,0);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index a6af03344b84..01166bf43638 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -7604,7 +7604,7 @@ void Test::testFuncMDETERM()
#endif
}
- int aVals[] = {23, 31, 13, 12, 34, 64, 34, 31, 98, 32, 33, 63, 45, 54, 65, 76};
+ int const aVals[] = {23, 31, 13, 12, 34, 64, 34, 31, 98, 32, 33, 63, 45, 54, 65, 76};
int nIdx = 0;
for( SCROW nRow = 0; nRow < 4; nRow++ )
for( SCCOL nCol = 0; nCol < 4; nCol++ )
diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index 0b80e89f2207..d04b2e4d7249 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -481,7 +481,7 @@ void Test::testPivotTableDateLabels()
}
{
- const char* aChecks[] = {
+ const char* const aChecks[] = {
"2011-01-01", "2011-01-02", "2011-01-03"
};
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index b057f64f2b0d..db91442be673 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -378,7 +378,7 @@ void Test::testSortWithFormulaRefs()
"=IF($List1.A7<>\"\";$List1.A7;\"\")",
};
- const char* aTextData[4] = {
+ const char* const aTextData[4] = {
"bob",
"tim",
"brian",
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index a3a7853b9c6f..4b67c4a2f3b1 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -2266,7 +2266,7 @@ void ScConditionalFormatList::RemoveFromDocument(ScDocument* pDoc) const
ScRangeList aRange = GetCombinedRange();
ScMarkData aMark;
aMark.MarkFromRangeList(aRange, true);
- sal_uInt16 pItems[2] = { ATTR_CONDITIONAL,0};
+ sal_uInt16 const pItems[2] = { ATTR_CONDITIONAL,0};
pDoc->ClearSelectionItems(pItems, aMark);
}
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 653e73da36ac..dd1933c862c2 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1499,7 +1499,7 @@ public:
// set work group size and execute
size_t global_work_size[] = { 256, (size_t)w };
- size_t local_work_size[] = { 256, 1 };
+ size_t const local_work_size[] = { 256, 1 };
SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
global_work_size, local_work_size, 0, nullptr, nullptr);
@@ -1557,7 +1557,7 @@ public:
// set work group size and execute
size_t global_work_size1[] = { 256, (size_t)w };
- size_t local_work_size1[] = { 256, 1 };
+ size_t const local_work_size1[] = { 256, 1 };
SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
global_work_size1, local_work_size1, 0, nullptr, nullptr);
@@ -2268,7 +2268,7 @@ public:
// set work group size and execute
size_t global_work_size[] = { 256, (size_t)nVectorWidth };
- size_t local_work_size[] = { 256, 1 };
+ size_t const local_work_size[] = { 256, 1 };
SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
global_work_size, local_work_size, 0, nullptr, nullptr);
@@ -2352,7 +2352,7 @@ public:
throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
// set work group size and execute
size_t global_work_size[] = { 256, (size_t)nVectorWidth };
- size_t local_work_size[] = { 256, 1 };
+ size_t const local_work_size[] = { 256, 1 };
SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel);
err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, nullptr,
global_work_size, local_work_size, 0, nullptr, nullptr);
diff --git a/sc/source/core/tool/typedstrdata.cxx b/sc/source/core/tool/typedstrdata.cxx
index 649ca160a224..b8cbcfeb6348 100644
--- a/sc/source/core/tool/typedstrdata.cxx
+++ b/sc/source/core/tool/typedstrdata.cxx
@@ -75,8 +75,7 @@ bool ScTypedStrData::EqualCaseInsensitive::operator() (const ScTypedStrData& lef
bool ScTypedStrData::operator< (const ScTypedStrData& r) const
{
// Case insensitive comparison by default.
- LessCaseInsensitive aHdl;
- return aHdl(*this, r);
+ return LessCaseInsensitive()(*this, r);
}
ScTypedStrData::ScTypedStrData(
@@ -99,13 +98,11 @@ bool FindTypedStrData::operator() (const ScTypedStrData& r) const
{
if (mbCaseSens)
{
- ScTypedStrData::EqualCaseSensitive aHdl;
- return aHdl(maVal, r);
+ return ScTypedStrData::EqualCaseSensitive()(maVal, r);
}
else
{
- ScTypedStrData::EqualCaseInsensitive aHdl;
- return aHdl(maVal, r);
+ return ScTypedStrData::EqualCaseInsensitive()(maVal, r);
}
}
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx
index bdf4b5537d8d..4f24fb366e0e 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -74,12 +74,12 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP,
: XMLFontAutoStylePool(rExportP, bBlockFontEmbedding)
, mpEditEnginePool(nullptr)
{
- sal_uInt16 aWhichIds[3] = { ATTR_FONT, ATTR_CJK_FONT,
- ATTR_CTL_FONT };
- sal_uInt16 aEditWhichIds[3] = { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
- EE_CHAR_FONTINFO_CTL };
- sal_uInt16 aPageWhichIds[4] = { ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERLEFT,
- ATTR_PAGE_HEADERRIGHT, ATTR_PAGE_FOOTERRIGHT };
+ sal_uInt16 const aWhichIds[] { ATTR_FONT, ATTR_CJK_FONT,
+ ATTR_CTL_FONT };
+ sal_uInt16 const aEditWhichIds[] { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
+ EE_CHAR_FONTINFO_CTL };
+ sal_uInt16 const aPageWhichIds[] { ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERLEFT,
+ ATTR_PAGE_HEADERRIGHT, ATTR_PAGE_FOOTERRIGHT };
const SfxItemPool* pItemPool(rExportP.GetDocument()->GetPool());
AddFontItems(aWhichIds, 3, pItemPool, true);
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index c88ed6023e47..d57041b56e9e 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -402,7 +402,7 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD
SetMinOutputSizePixel( maDialogSize );
- long nTabs[] = { 3, 10, 216, 266 };
+ long const nTabs[] = { 3, 10, 216, 266 };
m_pLbConflicts->SetTabs( nTabs );
OUString aTab('\t');
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index b9b672fd2756..969a35c7c10d 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -94,7 +94,7 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD
m_pCbShare->SetToggleHdl( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
m_pFtWarning->Enable( bIsDocShared );
- long nTabs[] = { 2, 0, 0 };
+ long const nTabs[] = { 2, 0, 0 };
m_pLbUsers->SetTabs( nTabs );
OUString aHeader(get<FixedText>("name")->GetText());
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index e5ca3cf4ca58..19e54619e45e 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -9447,8 +9447,7 @@ ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange
// Sort the vector by first range's start position, to avoid random shuffling
// due to using the ScPatterAttr pointers
- ScUniqueFormatsOrder aComp;
- ::std::sort( aRangeLists.begin(), aRangeLists.end(), aComp );
+ ::std::sort( aRangeLists.begin(), aRangeLists.end(), ScUniqueFormatsOrder() );
}
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 68c0216371d7..59928983559d 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -214,7 +214,7 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
// no format means use the current delimiter
sProps.realloc( 3 );
sProps[ nIndex ].Name = "FilterOptions";
- sal_Int16 delims[] = { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ };
+ sal_Int16 const delims[] { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ };
OUString sFormat;
sal_Int16 nFormat = 0; // default indicator
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 77865b57f8e7..1de9b9533815 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1131,12 +1131,11 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
}
else
{
- ScTypedStrData::EqualCaseSensitive aHdl;
std::vector<ScTypedStrData>::const_iterator itBeg = aStrings.begin(), itEnd = aStrings.end();
std::vector<ScTypedStrData>::const_iterator it = itBeg;
for (; it != itEnd && LISTBOX_ENTRY_NOTFOUND == nSelPos; ++it)
{
- if (aHdl(*it, *pNew))
+ if (ScTypedStrData::EqualCaseSensitive()(*it, *pNew))
nSelPos = std::distance(itBeg, it);
}
}
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 7fa2a3d990b9..03e2d148bd9a 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -247,10 +247,9 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
}
else
{
- OUString reason(
- "ScriptProtocolHandler::dispatchWithNotification failed, ScriptProtocolHandler not initialised"
+ invokeResult <<= OUString(
+ "ScriptProtocolHandler::dispatchWithNotification failed, ScriptProtocolHandler not initialised"
);
- invokeResult <<= reason;
}
if ( bCaughtException )
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index b5d083353f0f..3699af968a8f 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -53,12 +53,11 @@ ActiveMSPList::~ActiveMSPList()
Reference< provider::XScriptProvider >
ActiveMSPList::createNewMSP( const uno::Any& context )
{
- OUString serviceName("com.sun.star.script.provider.MasterScriptProvider");
Sequence< Any > args( &context, 1 );
Reference< provider::XScriptProvider > msp(
m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
- serviceName, args, m_xContext ), UNO_QUERY );
+ "com.sun.star.script.provider.MasterScriptProvider", args, m_xContext ), UNO_QUERY );
return msp;
}
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 65b4fa4f5f02..f4ad90358785 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -136,7 +136,7 @@ ProviderCache::populateCache()
::osl::Guard< osl::Mutex > aGuard( m_mutex );
try
{
- OUString languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider" );
+ OUString const languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider" );
Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW );
Reference< container::XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( languageProviderName );
@@ -151,11 +151,10 @@ ProviderCache::populateCache()
if ( serviceNames.getLength() > 0 )
{
- OUString searchString( "com.sun.star.script.provider.ScriptProviderFor" );
-
for ( sal_Int32 index = 0; index < serviceNames.getLength(); index++ )
{
- if ( serviceNames[ index ].startsWith( searchString ) && !isInBlackList( serviceNames[ index ] ) )
+ if ( serviceNames[ index ].startsWith( "com.sun.star.script.provider.ScriptProviderFor" )
+ && !isInBlackList( serviceNames[ index ] ) )
{
serviceName = serviceNames[ index ];
ProviderDetails details;
@@ -186,8 +185,7 @@ ProviderCache::createProvider( ProviderDetails& details )
}
catch ( const Exception& e )
{
- OUString temp("ProviderCache::createProvider() Error creating provider from factory!!!\n");
- throw RuntimeException( temp.concat( e.Message ) );
+ throw RuntimeException( "ProviderCache::createProvider() Error creating provider from factory. " + e.Message );
}
return details.provider;
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 4d328e22d716..100af7be69ea 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -441,8 +441,7 @@ void StringResourceImpl::newLocale( const Locale& locale )
if( getItemForLocale( locale, false ) != nullptr )
{
- OUString errorMsg("StringResourceImpl: locale already exists");
- throw ElementExistException( errorMsg );
+ throw ElementExistException( "StringResourceImpl: locale already exists" );
}
// TODO?: Check if locale is valid? How?
@@ -593,8 +592,7 @@ sal_Int32 StringResourceImpl::getUniqueNumericId( )
if( m_nNextUniqueNumericId < UNIQUE_NUMBER_NEEDS_INITIALISATION )
{
- OUString errorMsg("getUniqueNumericId: Extended sal_Int32 range");
- throw NoSupportException( errorMsg );
+ throw NoSupportException( "getUniqueNumericId: Extended sal_Int32 range" );
}
return m_nNextUniqueNumericId;
}
@@ -739,23 +737,20 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters
bool bReadOnlyOk = (aArguments[1] >>= m_bReadOnly);
if( !bReadOnlyOk )
{
- OUString errorMsg("XInitialization::initialize: Expected ReadOnly flag");
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 1 );
+ throw IllegalArgumentException( "XInitialization::initialize: Expected ReadOnly flag", Reference< XInterface >(), 1 );
}
css::lang::Locale aCurrentLocale;
bool bLocaleOk = (aArguments[2] >>= aCurrentLocale);
if( !bLocaleOk )
{
- OUString errorMsg("XInitialization::initialize: Expected Locale");
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 2 );
+ throw IllegalArgumentException( "XInitialization::initialize: Expected Locale", Reference< XInterface >(), 2 );
}
bool bNameBaseOk = (aArguments[3] >>= m_aNameBase);
if( !bNameBaseOk )
{
- OUString errorMsg("XInitialization::initialize: Expected NameBase string");
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 3 );
+ throw IllegalArgumentException( "XInitialization::initialize: Expected NameBase string", Reference< XInterface >(), 3 );
}
if( m_aNameBase.isEmpty() )
m_aNameBase = aNameBaseDefaultStr;
@@ -763,8 +758,7 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters
bool bCommentOk = (aArguments[4] >>= m_aComment);
if( !bCommentOk )
{
- OUString errorMsg("XInitialization::initialize: Expected Comment string");
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 4 );
+ throw IllegalArgumentException( "XInitialization::initialize: Expected Comment string", Reference< XInterface >(), 4 );
}
implScanLocales();
@@ -2191,8 +2185,7 @@ void StringResourceWithStorageImpl::initialize( const Sequence< Any >& aArgument
if( !bOk )
{
- OUString errorMsg("StringResourceWithStorageImpl::initialize: invalid storage");
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+ throw IllegalArgumentException( "StringResourceWithStorageImpl::initialize: invalid storage", Reference< XInterface >(), 0 );
}
implInitializeCommonParameters( aArguments );
@@ -2352,8 +2345,7 @@ void StringResourceWithStorageImpl::setStorage( const Reference< XStorage >& Sto
if( !Storage.is() )
{
- OUString errorMsg( "StringResourceWithStorageImpl::setStorage: invalid storage" );
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+ throw IllegalArgumentException( "StringResourceWithStorageImpl::setStorage: invalid storage", Reference< XInterface >(), 0 );
}
implLoadAllLocales();
@@ -2660,8 +2652,7 @@ void StringResourceWithLocationImpl::setURL( const OUString& URL )
sal_Int32 nLen = URL.getLength();
if( nLen == 0 )
{
- OUString errorMsg( "StringResourceWithLocationImpl::setURL: invalid URL" );
- throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+ throw IllegalArgumentException( "StringResourceWithLocationImpl::setURL: invalid URL", Reference< XInterface >(), 0 );
}
implLoadAllLocales();
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 15ba3c9fb9a1..5156ca1b4272 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -241,8 +241,7 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
if( aMatches.size() > 1 )
{
- OrdNumSorter aSortHelper;
- std::sort( aMatches.begin(), aMatches.end(), aSortHelper );
+ std::sort( aMatches.begin(), aMatches.end(), OrdNumSorter() );
}
if( nIndex > 0 )
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 18a785284620..99639f66e672 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -213,8 +213,9 @@ SfxItemSet& SdStyleSheet::GetItemSet()
// we create the ItemSet 'on demand' if necessary
if (!pSet)
{
- sal_uInt16 nWhichPairTable[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST,
- XATTR_FILL_FIRST, XATTR_FILL_LAST,
+ sal_uInt16 const nWhichPairTable[] {
+ XATTR_LINE_FIRST, XATTR_LINE_LAST,
+ XATTR_FILL_FIRST, XATTR_FILL_LAST,
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST,
SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_CONTOURFRAME,
@@ -239,8 +240,9 @@ SfxItemSet& SdStyleSheet::GetItemSet()
{
if (!pSet)
{
- sal_uInt16 nWhichPairTable[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST,
- XATTR_FILL_FIRST, XATTR_FILL_LAST,
+ sal_uInt16 const nWhichPairTable[] {
+ XATTR_LINE_FIRST, XATTR_LINE_LAST,
+ XATTR_FILL_FIRST, XATTR_FILL_LAST,
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST,
SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_CONTOURFRAME,
@@ -276,7 +278,8 @@ SfxItemSet& SdStyleSheet::GetItemSet()
{
if (!pSet)
{
- sal_uInt16 nWhichPairTable[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST,
+ sal_uInt16 const nWhichPairTable[] {
+ XATTR_LINE_FIRST, XATTR_LINE_LAST,
XATTR_FILL_FIRST, XATTR_FILL_LAST,
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST,
@@ -289,9 +292,8 @@ SfxItemSet& SdStyleSheet::GetItemSet()
EE_PARA_START, EE_CHAR_END,
- SDRATTR_XMLATTRIBUTES, SDRATTR_TEXT_USEFIXEDCELLHEIGHT,
-
- SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
+ SDRATTR_XMLATTRIBUTES, SDRATTR_TEXT_USEFIXEDCELLHEIGHT,
+ SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
0, 0 };
pSet = new SfxItemSet(GetPool().GetPool(), nWhichPairTable);
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 3fb0c9bc5a81..d2b0d7ceb0d5 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -112,7 +112,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotSt
if ( pSummaryInformation->IsValid() )
{
pSummaryInformation->Read();
- sal_uInt8 aPropSetGUID[ 16 ] =
+ sal_uInt8 const aPropSetGUID[ 16 ]
{
0xe0, 0x85, 0x9f, 0xf2, 0xf9, 0x4f, 0x68, 0x10, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9
};
@@ -265,7 +265,7 @@ bool ImplSdPPTImport::Import()
pDInfoSec2->Read();
- sal_uInt8 aPropSetGUID[ 16 ] =
+ sal_uInt8 const aPropSetGUID[ 16 ]
{
0x02, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
};
@@ -363,7 +363,7 @@ bool ImplSdPPTImport::Import()
}
}
- sal_uInt8 aUserPropSetGUID[ 16 ] =
+ sal_uInt8 const aUserPropSetGUID[ 16 ]
{
0x05, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
};
@@ -1856,8 +1856,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
}
}
- Ppt97AnimationStlSortHelper aSortHelper;
- std::sort( aAnimationsOnThisPage.begin(), aAnimationsOnThisPage.end(), aSortHelper );
+ std::sort( aAnimationsOnThisPage.begin(), aAnimationsOnThisPage.end(), Ppt97AnimationStlSortHelper() );
tAnimationVector::iterator aIter( aAnimationsOnThisPage.begin() );
const tAnimationVector::iterator aEnd( aAnimationsOnThisPage.end() );
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index a1d3f3f93b7b..d29ca491b166 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -820,10 +820,9 @@ Reference<frame::XModel> MasterPageContainer::Implementation::GetModel()
::comphelper::getProcessComponentContext() );
// Create a new model.
- OUString sModelServiceName ( "com.sun.star.presentation.PresentationDocument");
mxModel.set(
::comphelper::getProcessServiceFactory()->createInstance(
- sModelServiceName),
+ "com.sun.star.presentation.PresentationDocument"),
uno::UNO_QUERY);
// Initialize the model.
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 23b733b5caf8..352994d067da 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1359,8 +1359,8 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property
uno::Sequence<uno::Any> aSeq;
int nSeqIndex = 0;
- sal_uInt16 aWhichIds[3] = { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
- EE_CHAR_FONTINFO_CTL };
+ sal_uInt16 const aWhichIds[] { EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK,
+ EE_CHAR_FONTINFO_CTL };
const SfxItemPool& rPool = mpDoc->GetPool();
const SfxPoolItem* pItem;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 47fcf8144086..15aeca53f41d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1818,7 +1818,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_SHOW_NEXT_LEVEL:
{
- const char* STR_PRESOBJ_MPOUTLINE_ARY[] =
+ const char* const STR_PRESOBJ_MPOUTLINE_ARY[]
{
STR_PRESOBJ_MPOUTLINE,
STR_PRESOBJ_MPOUTLLAYER2,
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index 1448c31763eb..c6f07fd63840 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -110,7 +110,7 @@ void OptimizerDialog::InitRoadmap()
InsertRoadmapItem( 3, getString( STR_OLE_OBJECTS ), ITEM_ID_OLE_OPTIMIZATION );
InsertRoadmapItem( 4, getString( STR_SUMMARY ), ITEM_ID_SUMMARY );
- OUString sURL("private:graphicrepository/" BMP_PRESENTATION_MINIMIZER);
+ OUString const sURL("private:graphicrepository/" BMP_PRESENTATION_MINIMIZER);
xPropertySet->setPropertyValue( "ImageURL", Any( sURL ) );
xPropertySet->setPropertyValue( "Activated", Any( true ) );
diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx
index acc4e9f6f7b2..197e8f2e4184 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -335,7 +335,7 @@ void SAL_CALL PresenterSlideShowView::clear()
rendering::ViewState aViewState (
geometry::AffineMatrix2D(1,0,0, 0,1,0),
nullptr);
- double aColor[4] = {0,0,0,0};
+ double const aColor[4] = {0,0,0,0};
rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0),
nullptr,
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 1e0c55907283..21d82ea94699 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -312,7 +312,7 @@ void ContentListBox_Impl::dispose()
void ContentListBox_Impl::InitRoot()
{
- OUString aHelpTreeviewURL( "vnd.sun.star.hier://com.sun.star.help.TreeView/" );
+ OUString const aHelpTreeviewURL( "vnd.sun.star.hier://com.sun.star.help.TreeView/" );
std::vector< OUString > aList =
SfxContentHelper::GetHelpTreeViewContents( aHelpTreeviewURL );
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f7337558c76e..5cb9e94f42b7 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1073,7 +1073,7 @@ void SAL_CALL SfxDocumentMetaData::init(
// NB: we do not handle the single-XML-file ODF variant, which would
// have the root element office:document.
// The root of such documents must be converted in the importer!
- OUString prefix(
+ OUString const prefix(
"/child::office:document-meta/child::office:meta");
css::uno::Reference<css::xml::dom::XNode> xDocNode(
m_xDoc, css::uno::UNO_QUERY_THROW);
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index 49edc07ad92c..61884e65a8a5 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -343,7 +343,7 @@ void read_ulf_file(const std::string& FileName, Substitutor& Substitutor)
StreamExceptionsEnabler sexc_in(in);
//skip the byte-order-mark 0xEF 0xBB 0xBF, identifying UTF8 files
- unsigned char BOM[3] = {0xEF, 0xBB, 0xBF};
+ unsigned char const BOM[3] = {0xEF, 0xBB, 0xBF};
char buff[3];
in.read(&buff[0], 3);
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 68ba77331b7d..d63d09c3b5e2 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -707,7 +707,7 @@ void SmXMLExport::ExportBinaryDiagonal(const SmNode *pNode, int nLevel)
{ // Scoping for <mo> creation
SvXMLElementExport aMo(*this, XML_NAMESPACE_MATH, XML_MO,
true, true);
- sal_Unicode nArse[2] = {MS_BACKSLASH,0x00};
+ sal_Unicode const nArse[2] = {MS_BACKSLASH,0x00};
GetDocHandler()->characters(nArse);
}
@@ -1138,7 +1138,7 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel)
//proper entity support required
SvXMLElementExport aMath(*this, XML_NAMESPACE_MATH, XML_MO,
true, true);
- sal_Unicode nArse[2] = {0xAF,0x00};
+ sal_Unicode const nArse[2] = {0xAF,0x00};
GetDocHandler()->characters(nArse);
}
break;
@@ -1147,7 +1147,7 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel)
//proper entity support required
SvXMLElementExport aMath(*this, XML_NAMESPACE_MATH, XML_MO,
true, true);
- sal_Unicode nArse[2] = {0x0332,0x00};
+ sal_Unicode const nArse[2] = {0x0332,0x00};
GetDocHandler()->characters(nArse);
}
break;
diff --git a/svl/qa/unit/items/test_itempool.cxx b/svl/qa/unit/items/test_itempool.cxx
index 00c2c2ee6eda..a3132be80b0a 100644
--- a/svl/qa/unit/items/test_itempool.cxx
+++ b/svl/qa/unit/items/test_itempool.cxx
@@ -33,7 +33,7 @@ class PoolItemTest : public CppUnit::TestFixture
void PoolItemTest::testPool()
{
- SfxItemInfo aItems[] =
+ SfxItemInfo const aItems[] =
{ { 1, true },
{ 2, false /* not poolable */ },
{ 3, false },
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 2f3059ec4378..d22f489a8a41 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -953,7 +953,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge )
const LanguageTag& rLoadedLocale = xLocaleData->getLoadedLanguageTag();
if ( !rLoadedLocale.equals( maLanguageTag ) )
{
- OUString aMsg("SvNumberFormatter::ImpGenerateCL: locales don't match:");
+ OUString const aMsg("SvNumberFormatter::ImpGenerateCL: locales don't match:");
LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg ));
}
// test XML locale data FormatElement entries
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 6046e44b8c37..6a815779425d 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -157,7 +157,7 @@ namespace svt
// first collect all known programmatic names
StringBag aKnownNames;
- OUString sLogicalFieldNames(STR_LOGICAL_FIELD_NAMES);
+ OUString const sLogicalFieldNames(STR_LOGICAL_FIELD_NAMES);
sal_Int32 nIndex = 0;
do
{
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index ab060c469658..bc80c48efd79 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -499,11 +499,9 @@ Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getSelectedAccess
void SAL_CALL SvxRectCtlAccessibleContext::deselectAccessibleChild( sal_Int32 /*nIndex*/ )
{
- OUString aMessage( "deselectAccessibleChild is not possible in this context" );
-
SAL_WARN( "svx", "SvxRectCtlAccessibleContext::deselectAccessibleChild() is not possible!" );
- throw lang::IndexOutOfBoundsException( aMessage, *this ); // never possible
+ throw lang::IndexOutOfBoundsException( "deselectAccessibleChild is not possible in this context", *this ); // never possible
}
// internals
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index f2d69f844eec..37b0b289dacf 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -506,9 +506,8 @@ void SvxSearchDialog::Construct_Impl()
{
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider =
configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
- uno::Sequence< uno::Any > aArgs(1);
- OUString sPath( "/org.openoffice.Office.Common/SearchOptions/");
- aArgs[0] <<= sPath;
+ uno::Sequence< uno::Any > aArgs {
+ Any(OUString( "/org.openoffice.Office.Common/SearchOptions/")) };
uno::Reference< uno::XInterface > xIFace = xConfigurationProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess",
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 8f5ea2dc91d5..8efe25d6111f 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -271,7 +271,7 @@ void SgaObjectBmp::WriteData( SvStream& rOut, const OUString& rDestDir ) const
{
// Set version
SgaObject::WriteData( rOut, rDestDir );
- char aDummy[ 10 ] = { 0 };
+ char const aDummy[ 10 ] = { 0 };
rOut.WriteBytes(aDummy, 10);
write_uInt16_lenPrefixed_uInt8s_FromOString(rOut, OString()); //dummy
write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
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);
diff --git a/test/source/sheet/xcellrangesquery.cxx b/test/source/sheet/xcellrangesquery.cxx
index 7496eded47d9..05c32c4ba328 100644
--- a/test/source/sheet/xcellrangesquery.cxx
+++ b/test/source/sheet/xcellrangesquery.cxx
@@ -44,7 +44,7 @@ void XCellRangesQuery::testQueryContentDifference()
void XCellRangesQuery::testQueryEmptyCells()
{
- OUString aExpected( "Sheet1.A1:A5,Sheet1.B1:C1,Sheet1.B5,Sheet1.C3:C5,Sheet1.D1:E5" );
+ OUString const aExpected( "Sheet1.A1:A5,Sheet1.B1:C1,Sheet1.B5,Sheet1.C3:C5,Sheet1.D1:E5" );
uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(init(),UNO_QUERY_THROW);
uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryEmptyCells();
OUString aResult = xRanges->getRangeAddressesAsString();
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 5b15a97eb225..261f859e2e8a 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -113,7 +113,7 @@ static sal_uInt8* ImplSysReadConfig( const OUString& rFileName,
if( aFile.read( pBuf, nPos, nRead ) == ::osl::FileBase::E_None && nRead == nPos )
{
//skip the byte-order-mark 0xEF 0xBB 0xBF, if it was UTF8 files
- unsigned char BOM[3] = {0xEF, 0xBB, 0xBF};
+ unsigned char const BOM[3] = {0xEF, 0xBB, 0xBF};
if (nRead > 2 && memcmp(pBuf, BOM, 3) == 0)
{
nRead -= 3;
@@ -156,7 +156,7 @@ static bool ImplSysWriteConfig( const OUString& rFileName,
//write the byte-order-mark 0xEF 0xBB 0xBF first , if it was UTF8 files
if ( rbIsUTF8BOM )
{
- unsigned char BOM[3] = {0xEF, 0xBB, 0xBF};
+ unsigned char const BOM[3] = {0xEF, 0xBB, 0xBF};
sal_uInt64 nUTF8BOMWritten;
if( aFile.write( BOM, 3, nUTF8BOMWritten ) == ::osl::FileBase::E_None && 3 == nUTF8BOMWritten )
{
diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
index cbe0e0787f70..caed0ef0b163 100644
--- a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
+++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
@@ -35,8 +35,7 @@ namespace
void webdav_local_test::NeonUriTest()
{
//try URL decomposition
- OUString aURL( "http://user%40anothername@server.biz:8040/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" );
- NeonUri aURI( aURL );
+ NeonUri aURI( "http://user%40anothername@server.biz:8040/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" );
CPPUNIT_ASSERT_EQUAL( OUString( "http" ), aURI.GetScheme() );
CPPUNIT_ASSERT_EQUAL( OUString( "server.biz" ), aURI.GetHost() );
CPPUNIT_ASSERT_EQUAL( OUString( "user%40anothername" ), aURI.GetUserInfo() );
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 6dc0bf1ca68a..6be5e6ce8824 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -1130,9 +1130,7 @@ OUString SvtLinguConfig::GetSpellAndGrammarContextSuggestionImage(
OUString aRes;
if (!rServiceImplName.isEmpty())
{
- OUString aImageName( "SpellAndGrammarContextMenuSuggestionImage" );
- OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
- aRes = aPath;
+ aRes = GetVendorImageUrl_Impl( rServiceImplName, "SpellAndGrammarContextMenuSuggestionImage" );
}
return aRes;
}
@@ -1144,9 +1142,7 @@ OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage(
OUString aRes;
if (!rServiceImplName.isEmpty())
{
- OUString aImageName( "SpellAndGrammarContextMenuDictionaryImage" );
- OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
- aRes = aPath;
+ aRes = GetVendorImageUrl_Impl( rServiceImplName, "SpellAndGrammarContextMenuDictionaryImage" );
}
return aRes;
}
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index e65713cb7d15..69cb9c066f49 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -641,8 +641,7 @@ void LocaleDataWrapper::getCurrSymbolsImpl()
{
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::getCurrSymbolsImpl: no default currency" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrSymbolsImpl: no default currency" ) );
}
nElem = 0;
if ( nElem >= nCnt )
@@ -748,8 +747,7 @@ void LocaleDataWrapper::getCurrFormatsImpl()
{ // bad luck
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::getCurrFormatsImpl: no currency formats" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrFormatsImpl: no currency formats" ) );
}
nCurrPositiveFormat = nCurrNegativeFormat = nCurrFormatDefault;
return;
@@ -796,8 +794,7 @@ void LocaleDataWrapper::getCurrFormatsImpl()
scanCurrFormatImpl( pFormatArr[nElem].Code, 0, nSign, nPar, nNum, nBlank, nSym );
if (areChecksEnabled() && (nNum == -1 || nSym == -1))
{
- OUString aMsg( "LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?" ) );
}
if (nBlank == -1)
{
@@ -824,8 +821,7 @@ void LocaleDataWrapper::getCurrFormatsImpl()
scanCurrFormatImpl( rCode, nDelim+1, nSign, nPar, nNum, nBlank, nSym );
if (areChecksEnabled() && (nNum == -1 || nSym == -1 || (nPar == -1 && nSign == -1)))
{
- OUString aMsg( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?" ) );
}
// NOTE: one of nPar or nSign are allowed to be -1
if (nBlank == -1)
@@ -957,8 +953,7 @@ DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode )
{
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::scanDateOrder: not all DMY present" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::scanDateOrder: not all DMY present" ) );
}
if (nDay == -1)
nDay = rCode.getLength();
@@ -979,8 +974,7 @@ DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode )
{
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::scanDateOrder: no magic applicable" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::scanDateOrder: no magic applicable" ) );
}
return DateOrder::DMY;
}
@@ -995,8 +989,7 @@ void LocaleDataWrapper::getDateOrdersImpl()
{ // bad luck
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::getDateOrdersImpl: no date formats" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getDateOrdersImpl: no date formats" ) );
}
nDateOrder = nLongDateOrder = DateOrder::DMY;
return;
@@ -1039,15 +1032,13 @@ void LocaleDataWrapper::getDateOrdersImpl()
{
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::getDateOrdersImpl: no edit" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getDateOrdersImpl: no edit" ) );
}
if ( nDef == -1 )
{
if (areChecksEnabled())
{
- OUString aMsg( "LocaleDataWrapper::getDateOrdersImpl: no default" );
- outputCheckMessage( appendLocaleInfo( aMsg ) );
+ outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getDateOrdersImpl: no default" ) );
}
if ( nMedium != -1 )
nDef = nMedium;
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 08874982d1b6..d74b5f0e3090 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -324,7 +324,7 @@ OUString StripScriptFromName(const OUString& _aName)
{
// I worry that someone will have a font which *does* have
// e.g. "Greek" legitimately at the end of its name :-(
- const char*suffixes[] = { " baltic",
+ const char*const suffixes[] = { " baltic",
" ce",
" cyr",
" greek",
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 60df24d784ab..54bb066ddd30 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -566,9 +566,9 @@ bool OpenGLSalGraphicsImpl::CheckOffscreenTexture()
{
glDrawBuffer( GL_COLOR_ATTACHMENT0 );
#if OSL_DEBUG_LEVEL > 0 // lets have some red debugging background.
- GLfloat clearColor[4] = { 1.0, 0, 0, 0 };
+ GLfloat const clearColor[4] = { 1.0, 0, 0, 0 };
#else
- GLfloat clearColor[4] = { 1.0, 1.0, 1.0, 0 };
+ GLfloat const clearColor[4] = { 1.0, 1.0, 1.0, 0 };
#endif
glClearBufferfv( GL_COLOR, 0, clearColor );
// FIXME: use glClearTexImage if we have it ?
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 07a0b6d80fe8..74e9d9454f7a 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -303,7 +303,7 @@ bool X11OpenGLContext::ImplInit()
if (pFBC && best_fbc != -1)
{
- int pContextAttribs[] =
+ int const pContextAttribs[] =
{
#if 0 // defined(DBG_UTIL)
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 619fa07e684d..a1b89d87a5a8 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -686,7 +686,7 @@ void SvmTest::testTextArray()
GDIMetaFile aGDIMetaFile;
ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev.get(), aGDIMetaFile);
- long aDX[] = { 10, 15, 20, 25, 30, 35 };
+ long const aDX[] = { 10, 15, 20, 25, 30, 35 };
pVirtualDev->DrawTextArray(Point(4,6), "123456", aDX, 1, 4);
checkTextArray(writeAndRead(aGDIMetaFile, "textarray.svm"));
diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx
index 7608c8252e48..6c4838af8e68 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -564,7 +564,7 @@ bool XPMReader::ImplGetPara ( sal_uLong nNumb )
bool XPMReader::ImplGetString()
{
- sal_uInt8 sID[] = "/* XPM */";
+ sal_uInt8 const sID[] = "/* XPM */";
sal_uInt8* pString = mpStringBuf;
mnStringSize = 0;
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index 8b26edacb5fa..6b576999507b 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -116,8 +116,7 @@ LogicalFontInstance* ImplFontCache::GetFontInstance( PhysicalFontCollection cons
// the most recently used font usually has a hit rate of >50%
LogicalFontInstance *pFontInstance = nullptr;
PhysicalFontFamily* pFontFamily = nullptr;
- IFSD_Equal aIFSD_Equal;
- if( mpFirstEntry && aIFSD_Equal( aFontSelData, mpFirstEntry->maFontSelData ) )
+ if( mpFirstEntry && IFSD_Equal()( aFontSelData, mpFirstEntry->maFontSelData ) )
pFontInstance = mpFirstEntry;
else
{
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 3cffc299c073..027e0c4238bd 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2105,7 +2105,7 @@ static void DumpSfnts(FILE *outf, sal_uInt8 *sfntP, sal_uInt32 sfntLen)
HexFmt *h = HexFmtNew(outf);
sal_uInt16 i, numTables = GetUInt16(sfntP, 4);
GlyphOffsets *go = GlyphOffsetsNew(sfntP, sfntLen);
- sal_uInt8 pad[] = {0,0,0,0}; /* zeroes */
+ sal_uInt8 const pad[] = {0,0,0,0}; /* zeroes */
if (numTables > nMaxPossibleTables)
{
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index e826d38be1fe..c169030f8f2a 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -407,7 +407,7 @@ bool CommonSalLayout::HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aVariationSe
// Find all GSUB lookups for “vert” feature.
hb_set_t* pLookups = hb_set_create();
- hb_tag_t pFeatures[] = { HB_TAG('v','e','r','t'), HB_TAG_NONE };
+ hb_tag_t const pFeatures[] = { HB_TAG('v','e','r','t'), HB_TAG_NONE };
hb_ot_layout_collect_lookups(pHbFace, HB_OT_TAG_GSUB, nullptr, nullptr, pFeatures, pLookups);
if (!hb_set_is_empty(pLookups))
{
@@ -592,7 +592,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
// preference. The coretext_aat shaper is available only on macOS,
// but there is no harm in always including it, HarfBuzz will
// ignore unavailable shapers.
- const char* pHbShapers[] = { "graphite2", "coretext_aat", "ot", "fallback", nullptr };
+ const char*const pHbShapers[] = { "graphite2", "coretext_aat", "ot", "fallback", nullptr };
hb_segment_properties_t aHbProps;
hb_buffer_get_segment_properties(pHbBuffer, &aHbProps);
hb_shape_plan_t* pHbPlan = hb_shape_plan_create_cached(pHbFace, &aHbProps, maFeatures.data(), maFeatures.size(), pHbShapers);
diff --git a/vcl/source/window/debugevent.cxx b/vcl/source/window/debugevent.cxx
index 2b83f4f92f03..b47532891c24 100644
--- a/vcl/source/window/debugevent.cxx
+++ b/vcl/source/window/debugevent.cxx
@@ -192,7 +192,7 @@ void DebugEventInjector::InjectKeyNavEdit()
struct {
double mnProb;
sal_uInt16 mnKey;
- } nWeights[] = {
+ } const nWeights[] = {
// edit / escape etc. - 50%
{ 0.20, KEY_SPACE },
{ 0.10, KEY_TAB },
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 5738e2140238..7c89186505e0 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -1077,8 +1077,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ
// prepare property for MULTIPLE request
Sequence< sal_Int8 > aData;
- Atom pTypes[4] = { XA_PIXMAP, XA_PIXMAP,
- XA_COLORMAP, XA_COLORMAP };
+ Atom const pTypes[4] = { XA_PIXMAP, XA_PIXMAP, XA_COLORMAP, XA_COLORMAP };
{
osl::MutexGuard aGuard(m_aMutex);
@@ -1088,7 +1087,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ
XA_ATOM,
32,
PropModeReplace,
- reinterpret_cast<unsigned char*>(pTypes),
+ reinterpret_cast<unsigned char const *>(pTypes),
4 );
}
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index def90351b09b..3033860d79dd 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -262,19 +262,19 @@ public:
0.1, 0.1, 0.1, 0.1
};
#endif
- drawing::LineCap eLineCaps[] = {
+ drawing::LineCap const eLineCaps[] = {
drawing::LineCap_BUTT, drawing::LineCap_ROUND, drawing::LineCap_SQUARE, drawing::LineCap_BUTT,
drawing::LineCap_BUTT, drawing::LineCap_ROUND, drawing::LineCap_SQUARE, drawing::LineCap_BUTT,
drawing::LineCap_BUTT, drawing::LineCap_ROUND, drawing::LineCap_SQUARE, drawing::LineCap_BUTT,
drawing::LineCap_BUTT, drawing::LineCap_ROUND, drawing::LineCap_SQUARE, drawing::LineCap_BUTT
};
- basegfx::B2DLineJoin eJoins[] = {
+ basegfx::B2DLineJoin const eJoins[] = {
basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round,
basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round,
basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round,
basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round
};
- double aLineWidths[] = {
+ double const aLineWidths[] = {
10.0, 15.0, 20.0, 10.0,
10.0, 15.0, 20.0, 10.0,
10.0, 15.0, 20.0, 10.0,
@@ -408,7 +408,7 @@ public:
std::vector<OUString> aFontNames;
- sal_uInt32 nCols[] = {
+ sal_uInt32 const nCols[] = {
COL_BLACK, COL_BLUE, COL_GREEN, COL_CYAN, COL_RED, COL_MAGENTA,
COL_BROWN, COL_GRAY, COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTGREEN,
COL_LIGHTCYAN, COL_LIGHTRED, COL_LIGHTMAGENTA, COL_YELLOW, COL_WHITE
@@ -562,7 +562,7 @@ public:
FontWeight aWeights[] = { WEIGHT_NORMAL,
WEIGHT_BOLD,
WEIGHT_NORMAL };
- FontItalic aItalics[] = { ITALIC_NONE,
+ FontItalic const aItalics[] = { ITALIC_NONE,
ITALIC_NONE,
ITALIC_NORMAL };
vcl::Font aFont(OUString::createFromAscii(
@@ -1127,8 +1127,8 @@ public:
std::vector<tools::Rectangle> aRegions(DemoRenderer::partition(rCtx,2, 2));
DemoRenderer::clearRects(rDev, aRegions);
- RenderType eRenderTypes[] = { RENDER_AS_BITMAP, RENDER_AS_OUTDEV,
- RENDER_AS_BITMAPEX, RENDER_AS_ALPHA_OUTDEV };
+ RenderType const eRenderTypes[] { RENDER_AS_BITMAP, RENDER_AS_OUTDEV,
+ RENDER_AS_BITMAPEX, RENDER_AS_ALPHA_OUTDEV };
for (size_t i = 0; i < aRegions.size(); i++)
SizeAndRender(rDev, aRegions[i], eRenderTypes[i], rCtx);
}
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 9bd4993fc588..6a79f2318055 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2919,7 +2919,7 @@ void DomainMapper::lcl_endSectionGroup()
// style, so force a dummy paragraph.
lcl_startParagraphGroup();
lcl_startCharacterGroup();
- sal_uInt8 sBreak[] = { 0xd };
+ sal_uInt8 const sBreak[] = { 0xd };
lcl_text(sBreak, 1);
lcl_endCharacterGroup();
lcl_endParagraphGroup();
@@ -3006,7 +3006,7 @@ void DomainMapper::lcl_startShape(uno::Reference<drawing::XShape> const& xShape)
{
m_pImpl->clearDeferredBreak(PAGE_BREAK);
lcl_startCharacterGroup();
- sal_uInt8 sBreak[] = { 0xd };
+ sal_uInt8 const sBreak[] = { 0xd };
lcl_text(sBreak, 1);
lcl_endCharacterGroup();
lcl_endParagraphGroup();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 37e48daf0c80..2f3a0b4e3893 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1157,7 +1157,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
aBorderLine.OuterLineWidth = (sal_Int16)rBorderLine.nLineWidth;
aBorderLine.LineDistance = 0;
}
- PropertyIds aBorderProps[4] =
+ PropertyIds const aBorderProps[] =
{
PROP_LEFT_BORDER,
PROP_RIGHT_BORDER,
@@ -1165,7 +1165,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
PROP_BOTTOM_BORDER
};
- for(PropertyIds & rBorderProp : aBorderProps)
+ for(PropertyIds const & rBorderProp : aBorderProps)
xGraphicObjectProperties->setPropertyValue(getPropertyName(rBorderProp), uno::makeAny(aBorderLine));
// setting graphic object shadow proerties
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 6d044ae5d5c3..47f5dae1999b 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -295,13 +295,12 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( )
// nXChFollow; following character 0 - tab, 1 - space, 2 - nothing
aNumberingProperties.push_back(lcl_makePropVal(PROP_LEVEL_FOLLOW, m_nXChFollow));
- const int nIds = 5;
- PropertyIds aReadIds[nIds] =
+ PropertyIds const aReadIds[] =
{
PROP_ADJUST, PROP_INDENT_AT, PROP_FIRST_LINE_INDENT,
- PROP_FIRST_LINE_OFFSET, PROP_LEFT_MARGIN
+ PROP_FIRST_LINE_OFFSET, PROP_LEFT_MARGIN
};
- for(PropertyIds & rReadId : aReadIds) {
+ for(PropertyIds const & rReadId : aReadIds) {
boost::optional<PropertyMap::Property> aProp = getProperty(rReadId);
if (aProp)
aNumberingProperties.push_back(
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 77e30bf386e2..165299318016 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -712,12 +712,12 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS
xRelationshipAccess.set((dynamic_cast<OOXMLStreamImpl&>(*pStream.get())).accessDocumentStream(), uno::UNO_QUERY);
if (xRelationshipAccess.is())
{
- OUString sChartType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart");
- OUString sChartTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/chart");
- OUString sFootersType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
- OUString sFootersTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/footer");
- OUString sHeaderType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
- OUString sHeaderTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/header");
+ OUString const sChartType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart");
+ OUString const sChartTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/chart");
+ OUString const sFootersType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
+ OUString const sFootersTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/footer");
+ OUString const sHeaderType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
+ OUString const sHeaderTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/header");
bool bFound = false;
bool bHeaderFooterFound = false;
diff --git a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx
index 19040d06fd74..1e9bb1f8942b 100644
--- a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx
@@ -332,7 +332,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
checkFirstRun();
if (bColumns)
{
- sal_uInt8 sBreak[] = { 0xe };
+ sal_uInt8 const sBreak[] = { 0xe };
Mapper().startCharacterGroup();
Mapper().text(sBreak, 1);
Mapper().endCharacterGroup();
@@ -381,7 +381,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
{
checkFirstRun();
checkNeedPap();
- sal_uInt8 sBreak[] = { 0xc };
+ sal_uInt8 const sBreak[] = { 0xc };
Mapper().text(sBreak, 1);
if (!m_bNeedPap)
{
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a7bd7ebfcf1a..edfc2accb964 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -549,7 +549,7 @@ void RTFDocumentImpl::runProps()
void RTFDocumentImpl::runBreak()
{
- sal_uInt8 sBreak[] = { 0xd };
+ sal_uInt8 const sBreak[] = { 0xd };
Mapper().text(sBreak, 1);
m_bNeedCr = false;
}