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/tdoc | |
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/tdoc')
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 42 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_contentcaps.cxx | 116 |
2 files changed, 77 insertions, 81 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index aae1913dc379..39fec06b4f24 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -525,7 +525,7 @@ uno::Any SAL_CALL Content::execute( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1003,7 +1003,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { // Append all Core Properties. xRow->appendString ( - beans::Property( OUString("ContentType"), + beans::Property( "ContentType", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND @@ -1013,7 +1013,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( ContentType eType = rData.getType(); xRow->appendString ( - beans::Property( OUString("Title"), + beans::Property( "Title", -1, cppu::UnoType<OUString>::get(), // Title is read-only for root and documents. @@ -1023,14 +1023,14 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( : 0 ) ), 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 @@ -1038,7 +1038,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( rData.getIsFolder() ); xRow->appendObject( beans::Property( - OUString("CreatableContentsInfo"), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -1048,7 +1048,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Storage is only supported by folders. if ( eType == FOLDER ) xRow->appendObject( - beans::Property( OUString("Storage"), + beans::Property( "Storage", -1, cppu::UnoType<embed::XStorage>::get(), beans::PropertyAttribute::BOUND @@ -1058,7 +1058,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // DocumentModel is only supported by documents. if ( eType == DOCUMENT ) xRow->appendObject( - beans::Property( OUString("DocumentModel"), + beans::Property( "DocumentModel", -1, cppu::UnoType<frame::XModel>::get(), beans::PropertyAttribute::BOUND @@ -1339,7 +1339,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1413,7 +1413,7 @@ uno::Any Content::open( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1447,7 +1447,7 @@ uno::Any Content::open( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1507,7 +1507,7 @@ uno::Any Content::open( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1690,7 +1690,7 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny(m_xIdentifier-> getContentIdentifier()), @@ -1947,7 +1947,7 @@ void Content::transfer( { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( rInfo.SourceURL ), beans::PropertyState_DIRECT_VALUE)); @@ -2026,7 +2026,7 @@ void Content::transfer( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( rInfo.SourceURL ), beans::PropertyState_DIRECT_VALUE)); @@ -2057,7 +2057,7 @@ void Content::transfer( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( rInfo.SourceURL ), beans::PropertyState_DIRECT_VALUE)); @@ -2095,7 +2095,7 @@ void Content::transfer( { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( aTargetUri ), beans::PropertyState_DIRECT_VALUE)); @@ -2137,7 +2137,7 @@ void Content::transfer( { uno::Any aProps = uno::makeAny(beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( rInfo.SourceURL ), beans::PropertyState_DIRECT_VALUE)); @@ -2159,7 +2159,7 @@ void Content::transfer( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( rInfo.SourceURL ), beans::PropertyState_DIRECT_VALUE)); @@ -2178,7 +2178,7 @@ void Content::transfer( uno::Any aProps = uno::makeAny( beans::PropertyValue( - OUString( "Uri"), + "Uri", -1, uno::makeAny( rInfo.SourceURL ), beans::PropertyState_DIRECT_VALUE)); @@ -2875,7 +2875,7 @@ ContentProperties::getCreatableContentsInfo() const { uno::Sequence< beans::Property > aProps( 1 ); aProps.getArray()[ 0 ] = beans::Property( - OUString("Title"), + "Title", -1, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND ); diff --git a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx index 9857ec8aefb3..4ebaf91bb0d1 100644 --- a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx +++ b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx @@ -103,28 +103,28 @@ uno::Sequence< beans::Property > Content::getProperties( // Mandatory 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 @@ -133,8 +133,7 @@ uno::Sequence< beans::Property > Content::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -159,28 +158,28 @@ uno::Sequence< beans::Property > Content::getProperties( // Mandatory 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 @@ -189,8 +188,7 @@ uno::Sequence< beans::Property > Content::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -200,7 +198,7 @@ uno::Sequence< beans::Property > Content::getProperties( // New properties beans::Property( - OUString( "Storage" ), + "Storage", -1, cppu::UnoType<embed::XStorage>::get(), beans::PropertyAttribute::BOUND @@ -222,28 +220,28 @@ uno::Sequence< beans::Property > Content::getProperties( // Mandatory 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 @@ -253,8 +251,7 @@ uno::Sequence< beans::Property > Content::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -264,7 +261,7 @@ uno::Sequence< beans::Property > Content::getProperties( // New properties beans::Property( - OUString( "DocumentModel" ), + "DocumentModel", -1, cppu::UnoType<frame::XModel>::get(), beans::PropertyAttribute::BOUND @@ -288,28 +285,28 @@ uno::Sequence< beans::Property > Content::getProperties( // Mandatory 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 @@ -319,8 +316,7 @@ uno::Sequence< beans::Property > Content::getProperties( // Optional standard properties beans::Property( - OUString( - "CreatableContentsInfo" ), + "CreatableContentsInfo", -1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), beans::PropertyAttribute::BOUND @@ -359,22 +355,22 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Mandatory 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() ), @@ -382,12 +378,12 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "delete" ), + "delete", -1, cppu::UnoType<bool>::get() ), ucb::CommandInfo( - OUString( "open" ), + "open", -1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ) @@ -408,22 +404,22 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Mandatory 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() ), @@ -431,17 +427,17 @@ uno::Sequence< ucb::CommandInfo > Content::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() ) @@ -464,22 +460,22 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Mandatory 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() ), @@ -487,27 +483,27 @@ uno::Sequence< ucb::CommandInfo > Content::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() ) @@ -530,22 +526,22 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Mandatory 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() ), @@ -553,17 +549,17 @@ uno::Sequence< ucb::CommandInfo > Content::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() ) @@ -588,22 +584,22 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Mandatory 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() ), @@ -611,7 +607,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // Optional standard commands ucb::CommandInfo( - OUString( "open" ), + "open", -1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ) |