diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-30 16:38:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-31 08:56:20 +0000 |
commit | 1c3e84d8192218befebcddae2ed9842d081dc6c7 (patch) | |
tree | f4fc5cddd181d6d49bf55f74e6d3d107b8ae8d18 /ucb/source/ucp/hierarchy | |
parent | e1e6cdbb1e9ff37f0bb740a70045c66953bec50c (diff) |
teach lolugin:stringconstant about calling constructors
so we can remove unnecessary calls to the OUString(literal) constructor
when calling constructors like this:
Foo(OUString("xxx"), 1)
Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36
Reviewed-on: https://gerrit.libreoffice.org/33698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/hierarchy')
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.cxx | 32 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx | 131 |
2 files changed, 79 insertions, 84 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 114a37df3fe8..db8da992afde 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -462,7 +462,7 @@ uno::Any SAL_CALL HierarchyContent::execute( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -974,28 +974,28 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( { // Append all Core Properties. xRow->appendString ( - beans::Property( OUString("ContentType"), + beans::Property( "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), rData.getContentType() ); xRow->appendString ( - beans::Property( OUString("Title"), + beans::Property( "Title", -1, cppu::UnoType<OUString>::get(), // @@@ Might actually be read-only! beans::PropertyAttribute::BOUND ), rData.getTitle() ); xRow->appendBoolean( - beans::Property( OUString("IsDocument"), + beans::Property( "IsDocument", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), rData.getIsDocument() ); xRow->appendBoolean( - beans::Property( OUString("IsFolder"), + beans::Property( "IsFolder", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND @@ -1004,7 +1004,7 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( if ( rData.getIsDocument() ) xRow->appendString( - beans::Property( OUString("TargetURL"), + beans::Property( "TargetURL", -1, cppu::UnoType<OUString>::get(), // @@@ Might actually be read-only! @@ -1012,7 +1012,7 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( rData.getTargetURL() ); xRow->appendObject( beans::Property( - OUString("CreatableContentsInfo"), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -1322,7 +1322,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1468,7 +1468,7 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1591,7 +1591,7 @@ void HierarchyContent::transfer( { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(rInfo.SourceURL), beans::PropertyState_DIRECT_VALUE)); @@ -1630,7 +1630,7 @@ void HierarchyContent::transfer( { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(xId->getContentIdentifier()), beans::PropertyState_DIRECT_VALUE)); @@ -1663,7 +1663,7 @@ void HierarchyContent::transfer( { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Folder"), + "Folder", -1, uno::makeAny(aId), beans::PropertyState_DIRECT_VALUE)); @@ -1793,7 +1793,7 @@ void HierarchyContent::transfer( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( xSource->m_xIdentifier-> @@ -1830,7 +1830,7 @@ HierarchyContentProperties::getCreatableContentsInfo() const uno::Sequence< beans::Property > aFolderProps( 1 ); aFolderProps.getArray()[ 0 ] = beans::Property( - OUString("Title"), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND ); @@ -1842,12 +1842,12 @@ HierarchyContentProperties::getCreatableContentsInfo() const uno::Sequence< beans::Property > aLinkProps( 2 ); aLinkProps.getArray()[ 0 ] = beans::Property( - OUString("Title"), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND ); aLinkProps.getArray()[ 1 ] = beans::Property( - OUString("TargetURL"), + "TargetURL", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND ); diff --git a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx index c8094aef3d35..af317bd18af0 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx @@ -97,28 +97,28 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Required properties beans::Property( - OUString( "ContentType" ), + "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsDocument" ), + "IsDocument", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsFolder" ), + "IsFolder", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "Title" ), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND @@ -128,15 +128,14 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Optional standard properties beans::Property( - OUString( "TargetURL" ), + "TargetURL", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -155,28 +154,28 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Required properties beans::Property( - OUString( "ContentType" ), + "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsDocument" ), + "IsDocument", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsFolder" ), + "IsFolder", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "Title" ), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND @@ -185,14 +184,13 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Optional standard properties beans::Property( - OUString( "TargetURL" ), + "TargetURL", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND ), beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -219,28 +217,28 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Required properties beans::Property( - OUString( "ContentType" ), + "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsDocument" ), + "IsDocument", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsFolder" ), + "IsFolder", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "Title" ), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND @@ -250,8 +248,7 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -270,28 +267,28 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Required properties beans::Property( - OUString( "ContentType" ), + "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsDocument" ), + "IsDocument", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsFolder" ), + "IsFolder", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "Title" ), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND @@ -300,8 +297,7 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -329,28 +325,28 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Required properties beans::Property( - OUString( "ContentType" ), + "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsDocument" ), + "IsDocument", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "IsFolder" ), + "IsFolder", -1, cppu::UnoType<bool>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( - OUString( "Title" ), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND @@ -360,8 +356,7 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -396,22 +391,22 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Required commands ucb::CommandInfo( - OUString( "getCommandInfo" ), + "getCommandInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertySetInfo" ), + "getPropertySetInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertyValues" ), + "getPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), ucb::CommandInfo( - OUString( "setPropertyValues" ), + "setPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ) @@ -432,22 +427,22 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Required commands ucb::CommandInfo( - OUString( "getCommandInfo" ), + "getCommandInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertySetInfo" ), + "getPropertySetInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertyValues" ), + "getPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), ucb::CommandInfo( - OUString( "setPropertyValues" ), + "setPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ), @@ -455,12 +450,12 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "delete" ), + "delete", -1, cppu::UnoType<bool>::get() ), ucb::CommandInfo( - OUString( "insert" ), + "insert", -1, cppu::UnoType<void>::get() ) @@ -486,22 +481,22 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Required commands ucb::CommandInfo( - OUString( "getCommandInfo" ), + "getCommandInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertySetInfo" ), + "getPropertySetInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertyValues" ), + "getPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), ucb::CommandInfo( - OUString( "setPropertyValues" ), + "setPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ), @@ -509,7 +504,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "open" ), + "open", -1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ) @@ -527,22 +522,22 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Required commands ucb::CommandInfo( - OUString( "getCommandInfo" ), + "getCommandInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertySetInfo" ), + "getPropertySetInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertyValues" ), + "getPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), ucb::CommandInfo( - OUString( "setPropertyValues" ), + "setPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ), @@ -550,27 +545,27 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "delete" ), + "delete", -1, cppu::UnoType<bool>::get() ), ucb::CommandInfo( - OUString( "insert" ), + "insert", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "open" ), + "open", -1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ), ucb::CommandInfo( - OUString( "transfer" ), + "transfer", -1, cppu::UnoType<ucb::TransferInfo>::get() ), ucb::CommandInfo( - OUString( "createNewContent" ), + "createNewContent", -1, cppu::UnoType<ucb::ContentInfo>::get() ) @@ -596,22 +591,22 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Required commands ucb::CommandInfo( - OUString( "getCommandInfo" ), + "getCommandInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertySetInfo" ), + "getPropertySetInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertyValues" ), + "getPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), ucb::CommandInfo( - OUString( "setPropertyValues" ), + "setPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ), @@ -619,7 +614,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "open" ), + "open", -1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ) @@ -637,22 +632,22 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Required commands ucb::CommandInfo( - OUString( "getCommandInfo" ), + "getCommandInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertySetInfo" ), + "getPropertySetInfo", -1, cppu::UnoType<void>::get() ), ucb::CommandInfo( - OUString( "getPropertyValues" ), + "getPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), ucb::CommandInfo( - OUString( "setPropertyValues" ), + "setPropertyValues", -1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ), @@ -660,17 +655,17 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "open" ), + "open", -1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ), ucb::CommandInfo( - OUString( "transfer" ), + "transfer", -1, cppu::UnoType<ucb::TransferInfo>::get() ), ucb::CommandInfo( - OUString( "createNewContent" ), + "createNewContent", -1, cppu::UnoType<ucb::ContentInfo>::get() ) |