diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-08 19:54:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-09 13:01:49 +0100 |
commit | ac396f2f6b058ddff8c394443669b8c5d8b97b71 (patch) | |
tree | fc5120838a69ced58c3cd2333718ffeb6d4adf67 /toolkit | |
parent | 0c20b68149797c8b0779534a8e0cb9045085d451 (diff) |
fix coverity parse errors
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/stdtabcontroller.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/tabpagemodel.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/helper/formpdfexport.cxx | 28 |
3 files changed, 16 insertions, 16 deletions
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 32c2e6e63c82..f762ff805c0d 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -111,7 +111,7 @@ bool StdTabController::ImplCreateComponentSequence( if ( pTabs ) { // opt: Constant String for TabStop name - static const OUStringLiteral aTabStopName = u"Tabstop"; + static constexpr OUStringLiteral aTabStopName = u"Tabstop"; Reference< XPropertySet > xPSet( xCtrl->getModel(), UNO_QUERY ); Reference< XPropertySetInfo > xInfo = xPSet->getPropertySetInfo(); diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 498e8329ffdf..aa0f1badef0c 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -141,7 +141,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument Reference<XPropertySet> xDialogProp(xDialogModel,UNO_QUERY); if ( xDialogProp.is() ) { - static const OUStringLiteral s_sResourceResolver = u"ResourceResolver"; + static constexpr OUStringLiteral s_sResourceResolver = u"ResourceResolver"; Reference<XPropertySet> xThis(*this,UNO_QUERY); xThis->setPropertyValue(s_sResourceResolver,xDialogProp->getPropertyValue(s_sResourceResolver)); xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE))); diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 188410af86d4..39c9915f77ac 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -58,7 +58,7 @@ namespace toolkitform using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; - const OUStringLiteral FM_PROP_NAME = u"Name"; + constexpr OUStringLiteral FM_PROP_NAME = u"Name"; namespace { @@ -67,7 +67,7 @@ namespace toolkitform */ sal_Int16 classifyFormControl( const Reference< XPropertySet >& _rxModel ) { - static const OUStringLiteral FM_PROP_CLASSID = u"ClassId"; + static constexpr OUStringLiteral FM_PROP_CLASSID = u"ClassId"; sal_Int16 nControlType = FormComponentType::CONTROL; Reference< XPropertySetInfo > xPSI; @@ -312,8 +312,8 @@ namespace toolkitform SAL_INFO("toolkit.helper", "describePDFControl: unable to get property HelpText"); } Any aText; - static const OUStringLiteral FM_PROP_TEXT = u"Text"; - static const OUStringLiteral FM_PROP_LABEL = u"Label"; + static constexpr OUStringLiteral FM_PROP_TEXT = u"Text"; + static constexpr OUStringLiteral FM_PROP_LABEL = u"Label"; if ( xPSI->hasPropertyByName( FM_PROP_TEXT ) ) aText = xModelProps->getPropertyValue( FM_PROP_TEXT ); else if ( xPSI->hasPropertyByName( FM_PROP_LABEL ) ) @@ -326,7 +326,7 @@ namespace toolkitform // readonly - static const OUStringLiteral FM_PROP_READONLY = u"ReadOnly"; + static constexpr OUStringLiteral FM_PROP_READONLY = u"ReadOnly"; if ( xPSI->hasPropertyByName( FM_PROP_READONLY ) ) if( ! (xModelProps->getPropertyValue( FM_PROP_READONLY ) >>= Descriptor->ReadOnly) ) SAL_WARN("toolkit.helper", "describePDFControl: unable to get property " << FM_PROP_READONLY); @@ -334,7 +334,7 @@ namespace toolkitform // border { - static const OUStringLiteral FM_PROP_BORDER = u"Border"; + static constexpr OUStringLiteral FM_PROP_BORDER = u"Border"; if ( xPSI->hasPropertyByName( FM_PROP_BORDER ) ) { sal_Int16 nBorderType = 0; @@ -356,7 +356,7 @@ namespace toolkitform // background color - static const OUStringLiteral FM_PROP_BACKGROUNDCOLOR = u"BackgroundColor"; + static constexpr OUStringLiteral FM_PROP_BACKGROUNDCOLOR = u"BackgroundColor"; if ( xPSI->hasPropertyByName( FM_PROP_BACKGROUNDCOLOR ) ) { Color nBackColor = COL_TRANSPARENT; @@ -367,7 +367,7 @@ namespace toolkitform // text color - static const OUStringLiteral FM_PROP_TEXTCOLOR = u"TextColor"; + static constexpr OUStringLiteral FM_PROP_TEXTCOLOR = u"TextColor"; if ( xPSI->hasPropertyByName( FM_PROP_TEXTCOLOR ) ) { Color nTextColor = COL_TRANSPARENT; @@ -382,7 +382,7 @@ namespace toolkitform // multi line and word break // The MultiLine property of the control is mapped to both the "MULTILINE" and // "WORDBREAK" style flags - static const OUStringLiteral FM_PROP_MULTILINE = u"MultiLine"; + static constexpr OUStringLiteral FM_PROP_MULTILINE = u"MultiLine"; if ( xPSI->hasPropertyByName( FM_PROP_MULTILINE ) ) { bool bMultiLine = false; @@ -393,7 +393,7 @@ namespace toolkitform } // horizontal alignment - static const OUStringLiteral FM_PROP_ALIGN = u"Align"; + static constexpr OUStringLiteral FM_PROP_ALIGN = u"Align"; if ( xPSI->hasPropertyByName( FM_PROP_ALIGN ) ) { sal_Int16 nAlign = awt::TextAlign::LEFT; @@ -429,7 +429,7 @@ namespace toolkitform } // font - static const OUStringLiteral FM_PROP_FONT = u"FontDescriptor"; + static constexpr OUStringLiteral FM_PROP_FONT = u"FontDescriptor"; if ( xPSI->hasPropertyByName( FM_PROP_FONT ) ) { FontDescriptor aUNOFont; @@ -473,7 +473,7 @@ namespace toolkitform pEditWidget->FileSelect = true; // maximum text length - static const OUStringLiteral FM_PROP_MAXTEXTLEN = u"MaxTextLen"; + static constexpr OUStringLiteral FM_PROP_MAXTEXTLEN = u"MaxTextLen"; if ( xPSI->hasPropertyByName( FM_PROP_MAXTEXTLEN ) ) { sal_Int16 nMaxTextLength = 0; @@ -494,7 +494,7 @@ namespace toolkitform FormButtonType eButtonType = FormButtonType_PUSH; if( ! (xModelProps->getPropertyValue("ButtonType") >>= eButtonType) ) SAL_WARN("toolkit.helper", "describePDFControl: unable to get property ButtonType"); - static const OUStringLiteral FM_PROP_TARGET_URL = u"TargetURL"; + static constexpr OUStringLiteral FM_PROP_TARGET_URL = u"TargetURL"; if ( eButtonType == FormButtonType_SUBMIT ) { // if a button is a submit button, then it uses the URL at its parent form @@ -556,7 +556,7 @@ namespace toolkitform // check boxes - static const OUStringLiteral FM_PROP_STATE = u"State"; + static constexpr OUStringLiteral FM_PROP_STATE = u"State"; if ( Descriptor->getType() == vcl::PDFWriter::CheckBox ) { vcl::PDFWriter::CheckBoxWidget* pCheckBoxWidget = static_cast< vcl::PDFWriter::CheckBoxWidget* >( Descriptor.get() ); |