diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 16:57:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 13:31:57 +0200 |
commit | 60bc26354763fa3461db49a3e827da552484150d (patch) | |
tree | 5c66cee43f76f556f9a086a67fa8a6e88750c5d5 /sd | |
parent | 7867e1f1cdd726cb98a236245e3d08557cc3a313 (diff) |
new loplugin:conststringfield
Look for const string fields which can be static, and
mostly convert them to OUStringLiteral
And add a getLength() method to OUStringLiteral to make
the transition easier.
Remove dead code in XclExpRoot::GenerateDefaultEncryptionData,
default password is never empty.
Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091
Reviewed-on: https://gerrit.libreoffice.org/59204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 27 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/xml/sdtransform.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/presenter/PresenterTextView.cxx | 51 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.cxx | 117 |
5 files changed, 92 insertions, 121 deletions
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 0c0616558fa9..cccf3494a477 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -342,6 +342,11 @@ void lclAppendStyle(OUStringBuffer& aBuffer, const OUString& aTag, const OUStrin } // anonymous namespace +static const OUStringLiteral gaHTMLHeader( + "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n" + " \"http://www.w3.org/TR/html4/transitional.dtd\">\r\n" + "<html>\r\n<head>\r\n" ); + // constructor for the html export helper classes HtmlExport::HtmlExport( const OUString& aPath, @@ -369,10 +374,6 @@ HtmlExport::HtmlExport( maHTMLExtension(STR_HTMLEXP_DEFAULT_EXTENSION), maIndexUrl("index"), meScript( SCRIPT_ASP ), - maHTMLHeader( - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n" - " \"http://www.w3.org/TR/html4/transitional.dtd\">\r\n" - "<html>\r\n<head>\r\n" ), mpButtonSet( new ButtonSet() ) { bool bChange = mpDoc->IsChanged(); @@ -640,7 +641,7 @@ void HtmlExport::ExportSingleDocument() mnPagesWritten = 0; InitProgress(mnSdPageCount); - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(DocumentMetadata()); aStr.append("\r\n"); aStr.append("</head>\r\n"); @@ -1103,7 +1104,7 @@ bool HtmlExport::CreateHtmlTextForPresPages() } // HTML head - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[nSdPage])); @@ -1591,7 +1592,7 @@ bool HtmlExport::CreateHtmlForPresPages() } // HTML Head - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>" + StringToHTMLString(maPageNames[nSdPage]) + "</title>\r\n"); @@ -1916,7 +1917,7 @@ bool HtmlExport::CreateContentPage() SetDocColors(); // html head - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[0])); @@ -2056,7 +2057,7 @@ bool HtmlExport::CreateNotesPages() SetDocColors( pPage ); // Html head - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[0])); @@ -2095,7 +2096,7 @@ bool HtmlExport::CreateOutlinePages() for (sal_Int32 nPage = 0; nPage < (mbImpress?2:1) && bOk; ++nPage) { // Html head - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[0])); @@ -2408,7 +2409,7 @@ bool HtmlExport::CreateNavBarFrames() for( int nFile = 0; nFile < 3 && bOk; nFile++ ) { - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[0])); @@ -2511,7 +2512,7 @@ bool HtmlExport::CreateNavBarFrames() // the navigation bar outliner closed... if(bOk) { - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[0])); @@ -2534,7 +2535,7 @@ bool HtmlExport::CreateNavBarFrames() // ... and the outliner open if( bOk ) { - OUStringBuffer aStr(maHTMLHeader); + OUStringBuffer aStr(gaHTMLHeader); aStr.append(CreateMetaCharset()); aStr.append(" <title>"); aStr.append(StringToHTMLString(maPageNames[0])); diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx index 3bb86385e868..3a3e590621b0 100644 --- a/sd/source/filter/html/htmlex.hxx +++ b/sd/source/filter/html/htmlex.hxx @@ -138,8 +138,6 @@ class HtmlExport final OUString maCGIPath; PublishingScript meScript; - const OUString maHTMLHeader; - std::unique_ptr< ButtonSet > mpButtonSet; static SdrTextObj* GetLayoutTextObject(SdrPage const * pPage); diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx index ca1bfb12bbb8..17806cf90903 100644 --- a/sd/source/filter/xml/sdtransform.cxx +++ b/sd/source/filter/xml/sdtransform.cxx @@ -66,9 +66,6 @@ public: SdDrawDocument& mrDocument; SdrOutliner& mrOutliner; - const OUString msEnableNumbering; - const OUString msTextNamespace; - const OUString msTrue; }; /** transforms the given model from OOo 2.x to OOo 3.x. This maps @@ -83,12 +80,13 @@ void TransformOOo2xDocument( SdDrawDocument* pDocument ) } } +static const OUStringLiteral gsEnableNumbering( "enable-numbering" ); +static const OUStringLiteral gsTextNamespace( "urn:oasis:names:tc:opendocument:xmlns:text:1.0" ); +static const OUStringLiteral gsTrue( "true" ); + SdTransformOOo2xDocument::SdTransformOOo2xDocument( SdDrawDocument& rDocument ) : mrDocument( rDocument ) , mrOutliner( rDocument.GetDrawOutliner() ) -, msEnableNumbering( "enable-numbering" ) -, msTextNamespace( "urn:oasis:names:tc:opendocument:xmlns:text:1.0" ) -, msTrue( "true" ) { } @@ -282,10 +280,10 @@ bool SdTransformOOo2xDocument::getBulletState( const SfxItemSet& rSet, sal_uInt1 const sal_uInt16 nCount = rAttr.GetAttrCount(); for( sal_uInt16 nItem = 0; nItem < nCount; nItem++ ) { - if( ( rAttr.GetAttrLName( nItem ) == msEnableNumbering ) && ( rAttr.GetAttrNamespace( nItem ) == msTextNamespace ) ) + if( ( rAttr.GetAttrLName( nItem ) == gsEnableNumbering ) && ( rAttr.GetAttrNamespace( nItem ) == gsTextNamespace ) ) { const OUString& sValue( rAttr.GetAttrValue( nItem ) ); - rState = sValue == msTrue; + rState = sValue == gsTrue; return true; } } @@ -328,7 +326,7 @@ bool SdTransformOOo2xDocument::removeAlienAttributes( SfxItemSet& rSet, sal_uInt const sal_uInt16 nCount = rAttr.GetAttrCount(); for( sal_uInt16 nItem = 0; nItem < nCount; nItem++ ) { - if( ( rAttr.GetAttrLName( nItem ) == msEnableNumbering ) && ( rAttr.GetAttrNamespace( nItem ) == msTextNamespace ) ) + if( ( rAttr.GetAttrLName( nItem ) == gsEnableNumbering ) && ( rAttr.GetAttrNamespace( nItem ) == gsTextNamespace ) ) { if( nCount == 1 ) { diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index a1b7ca35ba8f..d41cd15a2dfc 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -48,22 +48,22 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; +static const OUStringLiteral gsTextPropertyName("Text"); +static const OUStringLiteral gsBitmapPropertyName("Bitmap"); +static const OUStringLiteral gsSizePropertyName("Size"); +static const OUStringLiteral gsBackgroundColorPropertyName("BackgroundColor"); +static const OUStringLiteral gsTextColorPropertyName("TextColor"); +static const OUStringLiteral gsFontDescriptorPropertyName("FontDescriptor"); +static const OUStringLiteral gsTopPropertyName("Top"); +static const OUStringLiteral gsTopRelativePropertyName("RelativeTop"); +static const OUStringLiteral gsTotalHeightPropertyName("TotalHeight"); + namespace sd { namespace presenter { // PresenterTextView::Implementation class PresenterTextView::Implementation { public: - const OUString msTextPropertyName; - const OUString msBitmapPropertyName; - const OUString msSizePropertyName; - const OUString msBackgroundColorPropertyName; - const OUString msTextColorPropertyName; - const OUString msFontDescriptorPropertyName; - const OUString msTopPropertyName; - const OUString msTopRelativePropertyName; - const OUString msTotalHeightPropertyName; - Implementation(); ~Implementation(); @@ -131,15 +131,15 @@ Any PresenterTextView::GetPropertyValue (const OUString& rsPropertyName) { ThrowIfDisposed(); - if (rsPropertyName == mpImplementation->msBitmapPropertyName) + if (rsPropertyName == gsBitmapPropertyName) { return Any(mpImplementation->GetBitmap()); } - else if (rsPropertyName == mpImplementation->msTopPropertyName) + else if (rsPropertyName == gsTopPropertyName) { return Any(mpImplementation->GetTop()); } - else if (rsPropertyName == mpImplementation->msTotalHeightPropertyName) + else if (rsPropertyName == gsTotalHeightPropertyName) { return Any(mpImplementation->GetTotalHeight()); } @@ -154,43 +154,43 @@ Any PresenterTextView::SetPropertyValue ( ThrowIfDisposed(); Any aOldValue; - if (rsPropertyName == mpImplementation->msTextPropertyName) + if (rsPropertyName == gsTextPropertyName) { OUString sText; if (rValue >>= sText) mpImplementation->SetText(sText); } - else if (rsPropertyName == mpImplementation->msSizePropertyName) + else if (rsPropertyName == gsSizePropertyName) { awt::Size aSize; if (rValue >>= aSize) mpImplementation->SetSize(Size(aSize.Width,aSize.Height)); } - else if (rsPropertyName == mpImplementation->msBackgroundColorPropertyName) + else if (rsPropertyName == gsBackgroundColorPropertyName) { util::Color aColor = util::Color(); if (rValue >>= aColor) mpImplementation->SetBackgroundColor(Color(aColor)); } - else if (rsPropertyName == mpImplementation->msTextColorPropertyName) + else if (rsPropertyName == gsTextColorPropertyName) { util::Color aColor = util::Color(); if (rValue >>= aColor) mpImplementation->SetTextColor(Color(aColor)); } - else if (rsPropertyName == mpImplementation->msFontDescriptorPropertyName) + else if (rsPropertyName == gsFontDescriptorPropertyName) { awt::FontDescriptor aFontDescriptor; if (rValue >>= aFontDescriptor) mpImplementation->SetFontDescriptor(aFontDescriptor); } - else if (rsPropertyName == mpImplementation->msTopPropertyName) + else if (rsPropertyName == gsTopPropertyName) { sal_Int32 nTop = 0; if (rValue >>= nTop) mpImplementation->SetTop(nTop); } - else if (rsPropertyName == mpImplementation->msTopRelativePropertyName) + else if (rsPropertyName == gsTopRelativePropertyName) { OUString sDistance; if (rValue >>= sDistance) @@ -214,16 +214,7 @@ void PresenterTextView::ThrowIfDisposed() // PresenterTextView::Implementation PresenterTextView::Implementation::Implementation() - : msTextPropertyName("Text"), - msBitmapPropertyName("Bitmap"), - msSizePropertyName("Size"), - msBackgroundColorPropertyName("BackgroundColor"), - msTextColorPropertyName("TextColor"), - msFontDescriptorPropertyName("FontDescriptor"), - msTopPropertyName("Top"), - msTopRelativePropertyName("RelativeTop"), - msTotalHeightPropertyName("TotalHeight"), - mxBitmap(), + : mxBitmap(), mpCanvas(), mpOutputDevice(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT)), mpEditEngine(nullptr), diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 62f49e13d060..092a64862104 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -1070,22 +1070,6 @@ uno::Any SdXShape::GetStyleSheet() const class SdUnoEventsAccess : public cppu::WeakImplHelper< css::container::XNameReplace, css::lang::XServiceInfo > { private: - const OUString maStrOnClick; - const OUString maStrServiceName; - const OUString maStrEventType; - const OUString maStrPresentation; - const OUString maStrLibrary; - const OUString maStrMacroName; - const OUString maStrClickAction; - const OUString maStrBookmark; - const OUString maStrEffect; - const OUString maStrPlayFull; - const OUString maStrVerb; - const OUString maStrSoundURL; - const OUString maStrSpeed; - const OUString maStrStarBasic; - const OUString maStrScript; - SdXShape* mpShape; public: @@ -1115,23 +1099,24 @@ uno::Reference< container::XNameReplace > SAL_CALL SdXShape::getEvents( ) return new SdUnoEventsAccess( this ); } +static const OUStringLiteral gaStrOnClick( "OnClick" ); +static const OUStringLiteral gaStrServiceName( "com.sun.star.documents.Events" ); +static const OUStringLiteral gaStrEventType( "EventType" ); +static const OUStringLiteral gaStrPresentation( "Presentation" ); +static const OUStringLiteral gaStrLibrary("Library"); +static const OUStringLiteral gaStrMacroName("MacroName"); +static const OUStringLiteral gaStrClickAction( "ClickAction" ); +static const OUStringLiteral gaStrBookmark( "Bookmark" ); +static const OUStringLiteral gaStrEffect( "Effect" ); +static const OUStringLiteral gaStrPlayFull( "PlayFull" ); +static const OUStringLiteral gaStrVerb( "Verb" ); +static const OUStringLiteral gaStrSoundURL( "SoundURL" ); +static const OUStringLiteral gaStrSpeed( "Speed" ); +static const OUStringLiteral gaStrStarBasic( "StarBasic" ); +static const OUStringLiteral gaStrScript( "Script" ); + SdUnoEventsAccess::SdUnoEventsAccess( SdXShape* pShape ) throw() -: maStrOnClick( "OnClick" ), - maStrServiceName( "com.sun.star.documents.Events" ), - maStrEventType( "EventType" ), - maStrPresentation( "Presentation" ), - maStrLibrary("Library"), - maStrMacroName("MacroName"), - maStrClickAction( "ClickAction" ), - maStrBookmark( "Bookmark" ), - maStrEffect( "Effect" ), - maStrPlayFull( "PlayFull" ), - maStrVerb( "Verb" ), - maStrSoundURL( "SoundURL" ), - maStrSpeed( "Speed" ), - maStrStarBasic( "StarBasic" ), - maStrScript( "Script" ), - mpShape( pShape ) + : mpShape( pShape ) { } @@ -1166,7 +1151,7 @@ static void clearEventsInAnimationInfo( SdAnimationInfo* pInfo ) // XNameReplace void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno::Any& aElement ) { - if( mpShape == nullptr || aName != maStrOnClick ) + if( mpShape == nullptr || aName != gaStrOnClick ) throw container::NoSuchElementException(); uno::Sequence< beans::PropertyValue > aProperties; @@ -1191,7 +1176,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno sal_Int32 nIndex; for( nIndex = 0; nIndex < nCount; nIndex++, pProperties++ ) { - if( !( nFound & FoundFlags::EventType ) && pProperties->Name == maStrEventType ) + if( !( nFound & FoundFlags::EventType ) && pProperties->Name == gaStrEventType ) { if( pProperties->Value >>= aStrEventType ) { @@ -1199,7 +1184,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::ClickAction ) && pProperties->Name == maStrClickAction ) + else if( !( nFound & FoundFlags::ClickAction ) && pProperties->Name == gaStrClickAction ) { if( pProperties->Value >>= eClickAction ) { @@ -1207,7 +1192,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::Macro ) && ( pProperties->Name == maStrMacroName || pProperties->Name == maStrScript ) ) + else if( !( nFound & FoundFlags::Macro ) && ( pProperties->Name == gaStrMacroName || pProperties->Name == gaStrScript ) ) { if( pProperties->Value >>= aStrMacro ) { @@ -1215,7 +1200,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::Library ) && pProperties->Name == maStrLibrary ) + else if( !( nFound & FoundFlags::Library ) && pProperties->Name == gaStrLibrary ) { if( pProperties->Value >>= aStrLibrary ) { @@ -1223,7 +1208,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::Effect ) && pProperties->Name == maStrEffect ) + else if( !( nFound & FoundFlags::Effect ) && pProperties->Name == gaStrEffect ) { if( pProperties->Value >>= eEffect ) { @@ -1231,7 +1216,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::Bookmark ) && pProperties->Name == maStrBookmark ) + else if( !( nFound & FoundFlags::Bookmark ) && pProperties->Name == gaStrBookmark ) { if( pProperties->Value >>= aStrBookmark ) { @@ -1239,7 +1224,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::Speed ) && pProperties->Name == maStrSpeed ) + else if( !( nFound & FoundFlags::Speed ) && pProperties->Name == gaStrSpeed ) { if( pProperties->Value >>= eSpeed ) { @@ -1247,7 +1232,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::SoundUrl ) && pProperties->Name == maStrSoundURL ) + else if( !( nFound & FoundFlags::SoundUrl ) && pProperties->Name == gaStrSoundURL ) { if( pProperties->Value >>= aStrSoundURL ) { @@ -1255,7 +1240,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::PlayFull ) && pProperties->Name == maStrPlayFull ) + else if( !( nFound & FoundFlags::PlayFull ) && pProperties->Name == gaStrPlayFull ) { if( pProperties->Value >>= bPlayFull ) { @@ -1263,7 +1248,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno continue; } } - else if( !( nFound & FoundFlags::Verb ) && pProperties->Name == maStrVerb ) + else if( !( nFound & FoundFlags::Verb ) && pProperties->Name == gaStrVerb ) { if( pProperties->Value >>= nVerb ) { @@ -1281,7 +1266,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno if( !( nFound & FoundFlags::EventType ) ) break; - if( aStrEventType == maStrPresentation ) + if( aStrEventType == gaStrPresentation ) { if( !( nFound & FoundFlags::ClickAction ) ) break; @@ -1436,7 +1421,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno // XNameAccess uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) { - if( mpShape == nullptr || aName != maStrOnClick ) + if( mpShape == nullptr || aName != gaStrOnClick ) throw container::NoSuchElementException(); SdAnimationInfo* pInfo = mpShape->GetAnimationInfo(); @@ -1486,15 +1471,15 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) if ( SfxApplication::IsXScriptURL( pInfo->GetBookmark() ) ) { // Scripting Framework URL - aAny <<= maStrScript; - pProperties->Name = maStrEventType; + aAny <<= OUString(gaStrScript); + pProperties->Name = gaStrEventType; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; aAny <<= pInfo->GetBookmark(); - pProperties->Name = maStrScript; + pProperties->Name = gaStrScript; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1503,8 +1488,8 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) else { // Old Basic macro URL - aAny <<= maStrStarBasic; - pProperties->Name = maStrEventType; + aAny <<= OUString(gaStrStarBasic); + pProperties->Name = gaStrEventType; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1527,14 +1512,14 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) sBuffer.append( aMacroName ); aAny <<= sBuffer.makeStringAndClear(); - pProperties->Name = maStrMacroName; + pProperties->Name = gaStrMacroName; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; aAny <<= OUString( "StarOffice" ); - pProperties->Name = maStrLibrary; + pProperties->Name = gaStrLibrary; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1542,15 +1527,15 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) } else { - aAny <<= maStrPresentation; - pProperties->Name = maStrEventType; + aAny <<= OUString(gaStrPresentation); + pProperties->Name = gaStrEventType; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; aAny <<= eClickAction; - pProperties->Name = maStrClickAction; + pProperties->Name = gaStrClickAction; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1569,7 +1554,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) case presentation::ClickAction_BOOKMARK: { const OUString aStrBookmark( getPageApiNameFromUiName( pInfo->GetBookmark()) ); - pProperties->Name = maStrBookmark; + pProperties->Name = gaStrBookmark; pProperties->Handle = -1; pProperties->Value <<= aStrBookmark; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1587,7 +1572,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) aURL += getPageApiNameFromUiName( aString.copy( nPos+1 ) ); aString = aURL; } - pProperties->Name = maStrBookmark; + pProperties->Name = gaStrBookmark; pProperties->Handle = -1; pProperties->Value <<= aString; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1596,14 +1581,14 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) case presentation::ClickAction_VANISH: aAny <<= pInfo->meSecondEffect; - pProperties->Name = maStrEffect; + pProperties->Name = gaStrEffect; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; aAny <<= pInfo->meSecondSpeed; - pProperties->Name = maStrSpeed; + pProperties->Name = gaStrSpeed; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1615,13 +1600,13 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) if( eClickAction == presentation::ClickAction_SOUND || pInfo->mbSecondSoundOn ) { aAny <<= pInfo->GetBookmark(); - pProperties->Name = maStrSoundURL; + pProperties->Name = gaStrSoundURL; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; - pProperties->Name = maStrPlayFull; + pProperties->Name = gaStrPlayFull; pProperties->Handle = -1; pProperties->Value <<= pInfo->mbSecondPlayFull; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1630,7 +1615,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) case presentation::ClickAction_VERB: aAny <<= static_cast<sal_Int32>(pInfo->mnVerb); - pProperties->Name = maStrVerb; + pProperties->Name = gaStrVerb; pProperties->Handle = -1; pProperties->Value = aAny; pProperties->State = beans::PropertyState_DIRECT_VALUE; @@ -1646,13 +1631,12 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) uno::Sequence< OUString > SAL_CALL SdUnoEventsAccess::getElementNames( ) { - uno::Sequence< OUString > aStr( &maStrOnClick, 1 ); - return aStr; + return { gaStrOnClick }; } sal_Bool SAL_CALL SdUnoEventsAccess::hasByName( const OUString& aName ) { - return aName == maStrOnClick; + return aName == gaStrOnClick; } // XElementAccess @@ -1679,8 +1663,7 @@ sal_Bool SAL_CALL SdUnoEventsAccess::supportsService( const OUString& ServiceNam uno::Sequence< OUString > SAL_CALL SdUnoEventsAccess::getSupportedServiceNames( ) { - uno::Sequence< OUString > aStr( &maStrServiceName, 1 ); - return aStr; + return { gaStrServiceName }; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |