summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-26 14:47:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 08:42:53 +0200
commit8dca2d5ac740f262b045f6529bd8e97af0ec9c47 (patch)
treee984203a66a5fb178b08341e53fab913a7af7d53 /svl
parent513ac8eb79e45de332d7ddab5b27c70578b904f1 (diff)
loplugin:oncevar in starmath..svl
Change-Id: I20e3796407c7e429a88d2811673929ac1141a41c Reviewed-on: https://gerrit.libreoffice.org/39280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/qa/unit/items/test_IndexedStyleSheets.cxx25
-rw-r--r--svl/qa/unit/svl.cxx2
-rw-r--r--svl/source/fsstor/fsstorage.cxx9
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx3
4 files changed, 14 insertions, 25 deletions
diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx
index 6560e7de6832..d7cccebaa833 100644
--- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx
+++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx
@@ -73,10 +73,8 @@ void IndexedStyleSheetsTest::InstantiationWorks()
void IndexedStyleSheetsTest::AddedStylesheetsCanBeFoundAndRetrievedByPosition()
{
- rtl::OUString name1("name1");
- rtl::OUString name2("name2");
- rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1));
- rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name2));
+ rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("name1"));
+ rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("name2"));
IndexedStyleSheets iss;
iss.AddStyleSheet(sheet1);
iss.AddStyleSheet(sheet2);
@@ -97,10 +95,8 @@ void IndexedStyleSheetsTest::AddingSameStylesheetTwiceHasNoEffect()
void IndexedStyleSheetsTest::RemovedStyleSheetIsNotFound()
{
- rtl::OUString name1("name1");
- rtl::OUString name2("name2");
- rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1));
- rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name2));
+ rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("name1"));
+ rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("name2"));
IndexedStyleSheets iss;
iss.AddStyleSheet(sheet1);
iss.AddStyleSheet(sheet2);
@@ -147,8 +143,8 @@ void IndexedStyleSheetsTest::StyleSheetsCanBeRetrievedByTheirName()
void IndexedStyleSheetsTest::KnowsThatItStoresAStyleSheet()
{
- rtl::OUString name1("name1");
- rtl::OUString name2("name2");
+ rtl::OUString const name1("name1");
+ rtl::OUString const name2("name2");
rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1));
rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name1));
rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name2));
@@ -169,12 +165,9 @@ void IndexedStyleSheetsTest::KnowsThatItStoresAStyleSheet()
void IndexedStyleSheetsTest::PositionCanBeQueriedByFamily()
{
- rtl::OUString name1("name1");
- rtl::OUString name2("name2");
- rtl::OUString name3("name3");
- rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1, SfxStyleFamily::Char));
- rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name2, SfxStyleFamily::Para));
- rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name3, SfxStyleFamily::Char));
+ rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("name1", SfxStyleFamily::Char));
+ rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("name2", SfxStyleFamily::Para));
+ rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet("name3", SfxStyleFamily::Char));
IndexedStyleSheets iss;
iss.AddStyleSheet(sheet1);
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 10fcbd5672b6..c8b030dc3e00 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -317,7 +317,7 @@ void Test::testSharedStringPool()
CPPUNIT_ASSERT_EQUAL(p1.getData(), p2.getData());
// Test case insensitive string ID's.
- OUString aAndyLower("andy"), aAndyUpper("ANDY");
+ OUString const aAndyLower("andy"), aAndyUpper("ANDY");
p1 = aPool.intern(aAndy);
p2 = aPool.intern(aAndyLower);
CPPUNIT_ASSERT_MESSAGE("Failed to intern strings.", p1.getData() && p2.getData());
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 9ca3cd228ffe..01df7112802a 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -189,11 +189,10 @@ void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const
OUString* pProps = aProps.getArray();
pProps[0] = "TargetURL";
pProps[1] = "IsFolder";
- ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
try
{
- uno::Reference< sdbc::XResultSet > xResultSet = pContent->createCursor( aProps, eInclude );
+ uno::Reference< sdbc::XResultSet > xResultSet = pContent->createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS );
uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY );
if ( xResultSet.is() )
{
@@ -918,10 +917,9 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames()
throw io::IOException(); // TODO: error handling
uno::Sequence<OUString> aProps { "Title" };
- ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
sal_Int32 nSize = 0;
- uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, eInclude );
+ uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS );
uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY );
if ( xResultSet.is() )
{
@@ -1019,9 +1017,8 @@ sal_Bool SAL_CALL FSStorage::hasElements()
throw io::IOException(); // TODO: error handling
uno::Sequence<OUString> aProps { "TargetURL" };
- ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
- uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, eInclude );
+ uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS );
return ( xResultSet.is() && xResultSet->next() );
}
catch (const uno::RuntimeException&)
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index eaed9780e490..8347d6a50049 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1104,8 +1104,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
if ( bCanChangePassword )
{
// ask for the new password, but do not set it
- PasswordRequestMode aRMode = PasswordRequestMode_PASSWORD_CREATE;
- OUString aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
+ OUString aPass = RequestPasswordFromUser( PasswordRequestMode_PASSWORD_CREATE, xTmpHandler );
if ( !aPass.isEmpty() )
{