diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-21 14:23:23 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-16 06:30:09 +0000 |
commit | 127f70d66ac32b7a4ec818adaf1bdccb71865ee5 (patch) | |
tree | a020d2002c2eea81484297421f0fbe3ee84c2db0 /sd | |
parent | ce95e39f8e952159844e9dc04a1df402bb103634 (diff) |
new loplugin to check for static OUStrings
that are better declared as OUStringLiteral
Change-Id: Ifb5d9a12bb31a68641940bec16971a8181a46567
Reviewed-on: https://gerrit.libreoffice.org/27377
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/accessibility/AccessibleSlideSorterView.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/table/TableDesignPane.cxx | 26 |
3 files changed, 12 insertions, 20 deletions
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx index 282a6436ad06..5b7125709eee 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx @@ -422,11 +422,10 @@ uno::Sequence< OUString> SAL_CALL { ThrowIfDisposed (); - static const OUString sServiceNames[2] = { + return uno::Sequence<OUString> { OUString("com.sun.star.accessibility.Accessible"), OUString("com.sun.star.accessibility.AccessibleContext") }; - return uno::Sequence<OUString> (sServiceNames, 2); } void AccessibleSlideSorterObject::ThrowIfDisposed() diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index 11cf574bd0f6..1afc650031a8 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -636,12 +636,11 @@ uno::Sequence< OUString> SAL_CALL { ThrowIfDisposed (); - static const OUString sServiceNames[3] = { + return uno::Sequence<OUString> { OUString("com.sun.star.accessibility.Accessible"), OUString("com.sun.star.accessibility.AccessibleContext"), OUString("com.sun.star.drawing.AccessibleSlideSorterView") }; - return uno::Sequence<OUString> (sServiceNames, 3); } void AccessibleSlideSorterView::ThrowIfDisposed() diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index f1eb9e83ba5f..c78d4d325543 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -77,19 +77,15 @@ static const sal_Int32 nCellHeight = 7; // one pixel is shared with the next cel static const sal_Int32 nBitmapWidth = (nCellWidth * nPreviewColumns) - (nPreviewColumns - 1); static const sal_Int32 nBitmapHeight = (nCellHeight * nPreviewRows) - (nPreviewRows - 1); -static const OUString* getPropertyNames() +static const OUStringLiteral gPropNames[ CB_COUNT ] = { - static const OUString gPropNames[ CB_COUNT ] = - { - OUString("UseFirstRowStyle") , - OUString("UseLastRowStyle") , - OUString("UseBandingRowStyle") , - OUString("UseFirstColumnStyle") , - OUString("UseLastColumnStyle") , - OUString("UseBandingColumnStyle") - }; - return &gPropNames[0]; -} + OUStringLiteral("UseFirstRowStyle") , + OUStringLiteral("UseLastRowStyle") , + OUStringLiteral("UseBandingRowStyle") , + OUStringLiteral("UseFirstColumnStyle") , + OUStringLiteral("UseLastColumnStyle") , + OUStringLiteral("UseBandingColumnStyle") +}; TableDesignWidget::TableDesignWidget( VclBuilderContainer* pParent, ViewShellBase& rBase, bool bModal ) : mrBase(rBase) @@ -112,10 +108,9 @@ TableDesignWidget::TableDesignWidget( VclBuilderContainer* pParent, ViewShellBas } m_pValueSet->SetSelectHdl (LINK(this, TableDesignWidget, implValueSetHdl)); - const OUString* pPropNames = getPropertyNames(); for (sal_uInt16 i = CB_HEADER_ROW; i <= CB_BANDED_COLUMNS; ++i) { - pParent->get(m_aCheckBoxes[i], OUStringToOString(pPropNames[i], RTL_TEXTENCODING_UTF8)); + pParent->get(m_aCheckBoxes[i], OUStringToOString(gPropNames[i], RTL_TEXTENCODING_UTF8)); m_aCheckBoxes[i]->SetClickHdl( LINK( this, TableDesignWidget, implCheckBoxHdl ) ); } @@ -378,14 +373,13 @@ void TableDesignWidget::updateControls() static const bool gDefaults[CB_COUNT] = { true, false, true, false, false, false }; const bool bHasTable = mxSelectedTable.is(); - const OUString* pPropNames = getPropertyNames(); for (sal_uInt16 i = CB_HEADER_ROW; i <= CB_BANDED_COLUMNS; ++i) { bool bUse = gDefaults[i]; if( bHasTable ) try { - mxSelectedTable->getPropertyValue( *pPropNames++ ) >>= bUse; + mxSelectedTable->getPropertyValue( gPropNames[i] ) >>= bUse; } catch( Exception& ) { |