summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-16 16:57:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-22 13:31:57 +0200
commit60bc26354763fa3461db49a3e827da552484150d (patch)
tree5c66cee43f76f556f9a086a67fa8a6e88750c5d5 /ucb
parent7867e1f1cdd726cb98a236245e3d08557cc3a313 (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 'ucb')
-rw-r--r--ucb/source/ucp/file/bc.cxx16
-rw-r--r--ucb/source/ucp/file/filtask.cxx37
-rw-r--r--ucb/source/ucp/file/filtask.hxx21
3 files changed, 30 insertions, 44 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index f42cdf84fd76..d72191b7c144 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -457,9 +457,9 @@ BaseContent::getContentType()
if( m_nState & JustInserted )
{
if ( m_bFolder )
- return m_pMyShell->FolderContentType;
+ return TaskManager::FolderContentType;
else
- return m_pMyShell->FileContentType;
+ return TaskManager::FileContentType;
}
else
{
@@ -477,9 +477,9 @@ BaseContent::getContentType()
if ( !xRow->wasNull() )
{
if ( IsDocument )
- return m_pMyShell->FileContentType;
+ return TaskManager::FileContentType;
else
- return m_pMyShell->FolderContentType;
+ return TaskManager::FolderContentType;
}
else
{
@@ -569,10 +569,10 @@ BaseContent::createNewContent( const ContentInfo& Info )
if ( Info.Type.isEmpty() )
return Reference< XContent >();
- bool bFolder = Info.Type == m_pMyShell->FolderContentType;
+ bool bFolder = Info.Type == TaskManager::FolderContentType;
if ( !bFolder )
{
- if ( Info.Type != m_pMyShell->FileContentType )
+ if ( Info.Type != TaskManager::FileContentType )
{
// Neither folder nor file to create!
return Reference< XContent >();
@@ -733,8 +733,8 @@ BaseContent::getPropertyValues(
if ( rProp.Name == "ContentType" )
{
- rValue <<= m_bFolder ? m_pMyShell->FolderContentType
- : m_pMyShell->FileContentType;
+ rValue <<= OUString(m_bFolder ? TaskManager::FolderContentType
+ : TaskManager::FileContentType);
}
else if ( rProp.Name == "IsFolder" )
{
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 4ae6cc06e15a..474942bb6040 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -116,28 +116,31 @@ TaskManager::MyProperty::~MyProperty()
#include "filinl.hxx"
+ // Default properties
+
+static const OUStringLiteral Title( "Title" );
+static const OUStringLiteral CasePreservingURL( "CasePreservingURL" );
+static const OUStringLiteral IsDocument( "IsDocument" );
+static const OUStringLiteral IsFolder( "IsFolder" );
+static const OUStringLiteral DateModified( "DateModified" );
+static const OUStringLiteral Size( "Size" );
+static const OUStringLiteral IsVolume( "IsVolume" );
+static const OUStringLiteral IsRemoveable( "IsRemoveable" );
+static const OUStringLiteral IsRemote( "IsRemote" );
+static const OUStringLiteral IsCompactDisc( "IsCompactDisc" );
+static const OUStringLiteral IsFloppy( "IsFloppy" );
+static const OUStringLiteral IsHidden( "IsHidden" );
+static const OUStringLiteral ContentType( "ContentType" );
+static const OUStringLiteral IsReadOnly( "IsReadOnly" );
+static const OUStringLiteral CreatableContentsInfo( "CreatableContentsInfo" );
+const OUStringLiteral TaskManager::FolderContentType( "application/vnd.sun.staroffice.fsys-folder" );
+const OUStringLiteral TaskManager::FileContentType( "application/vnd.sun.staroffice.fsys-file" );
+
TaskManager::TaskManager( const uno::Reference< uno::XComponentContext >& rxContext,
FileProvider* pProvider, bool bWithConfig )
: m_nCommandId( 0 ),
m_pProvider( pProvider ),
m_xContext( rxContext ),
- Title( "Title" ),
- CasePreservingURL( "CasePreservingURL" ),
- IsDocument( "IsDocument" ),
- IsFolder( "IsFolder" ),
- DateModified( "DateModified" ),
- Size( "Size" ),
- IsVolume( "IsVolume" ),
- IsRemoveable( "IsRemoveable" ),
- IsRemote( "IsRemote" ),
- IsCompactDisc( "IsCompactDisc" ),
- IsFloppy( "IsFloppy" ),
- IsHidden( "IsHidden" ),
- ContentType( "ContentType" ),
- IsReadOnly( "IsReadOnly" ),
- CreatableContentsInfo( "CreatableContentsInfo" ),
- FolderContentType( "application/vnd.sun.staroffice.fsys-folder" ),
- FileContentType( "application/vnd.sun.staroffice.fsys-file" ),
m_sCommandInfo( 9 )
{
// Title
diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx
index d50400f082de..6b151c2d45f3 100644
--- a/ucb/source/ucp/file/filtask.hxx
+++ b/ucb/source/ucp/file/filtask.hxx
@@ -645,28 +645,11 @@ namespace fileaccess
// General
ContentMap m_aContent;
- // Default properties
-
- const OUString Title;
- const OUString CasePreservingURL;
- const OUString IsDocument;
- const OUString IsFolder;
- const OUString DateModified;
- const OUString Size;
- const OUString IsVolume;
- const OUString IsRemoveable;
- const OUString IsRemote;
- const OUString IsCompactDisc;
- const OUString IsFloppy;
- const OUString IsHidden;
- const OUString ContentType;
- const OUString IsReadOnly;
- const OUString CreatableContentsInfo;
public:
- const OUString FolderContentType;
- const OUString FileContentType;
+ static const OUStringLiteral FolderContentType;
+ static const OUStringLiteral FileContentType;
private: