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/source/ui/presenter/PresenterTextView.cxx | |
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/source/ui/presenter/PresenterTextView.cxx')
-rw-r--r-- | sd/source/ui/presenter/PresenterTextView.cxx | 51 |
1 files changed, 21 insertions, 30 deletions
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), |