summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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>
Diffstat (limited to 'sd')
-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
6 files changed, 19 insertions, 20 deletions
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,