NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT is always true

and has been for more than a decade

Change-Id: I81dd8c6db0b3a961d2e2f2dfb4c0fb97704756d8
This commit is contained in:
Noel Grandin
2017-01-30 08:49:56 +02:00
parent 78220c485c
commit b67bdae596
3 changed files with 1 additions and 19 deletions

View File

@@ -457,7 +457,6 @@ uno::Any SAL_CALL Content::execute(
// Unreachable // Unreachable
} }
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
if ( eType == STREAM ) if ( eType == STREAM )
{ {
Uri aUri( m_xIdentifier->getContentIdentifier() ); Uri aUri( m_xIdentifier->getContentIdentifier() );
@@ -475,7 +474,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable // Unreachable
} }
} }
#endif
ucb::InsertCommandArgument aArg; ucb::InsertCommandArgument aArg;
if ( !( aCommand.Argument >>= aArg ) ) if ( !( aCommand.Argument >>= aArg ) )
{ {
@@ -668,7 +667,6 @@ Content::createNewContent( const ucb::ContentInfo& Info )
bool bCreateFolder = Info.Type == TDOC_FOLDER_CONTENT_TYPE; bool bCreateFolder = Info.Type == TDOC_FOLDER_CONTENT_TYPE;
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
// streams cannot be created as direct children of document root // streams cannot be created as direct children of document root
if ( !bCreateFolder && ( m_aProps.getType() == DOCUMENT ) ) if ( !bCreateFolder && ( m_aProps.getType() == DOCUMENT ) )
{ {
@@ -676,7 +674,6 @@ Content::createNewContent( const ucb::ContentInfo& Info )
"created as direct children of document root!" ); "created as direct children of document root!" );
return uno::Reference< ucb::XContent >(); return uno::Reference< ucb::XContent >();
} }
#endif
if ( !bCreateFolder && Info.Type != TDOC_STREAM_CONTENT_TYPE ) if ( !bCreateFolder && Info.Type != TDOC_STREAM_CONTENT_TYPE )
{ {
OSL_FAIL( "Content::createNewContent - unsupported type!" ); OSL_FAIL( "Content::createNewContent - unsupported type!" );
@@ -1563,7 +1560,6 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData,
Uri aUri( m_xIdentifier->getContentIdentifier() ); Uri aUri( m_xIdentifier->getContentIdentifier() );
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
if ( eType == STREAM ) if ( eType == STREAM )
{ {
@@ -1572,7 +1568,6 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData,
"insert command not supported by streams that are direct " "insert command not supported by streams that are direct "
"children of document root!" ); "children of document root!" );
} }
#endif
#endif #endif
// Check, if all required properties were set. // Check, if all required properties were set.
@@ -1966,7 +1961,6 @@ void Content::transfer(
} }
} }
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
if ( m_aProps.getType() == DOCUMENT ) if ( m_aProps.getType() == DOCUMENT )
{ {
bool bOK = false; bool bOK = false;
@@ -2018,7 +2012,6 @@ void Content::transfer(
// Unreachable // Unreachable
} }
} }
#endif
// Copy data. // Copy data.
@@ -2887,7 +2880,6 @@ ContentProperties::getCreatableContentsInfo() const
cppu::UnoType<OUString>::get(), cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::BOUND ); beans::PropertyAttribute::BOUND );
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
if ( getType() == DOCUMENT ) if ( getType() == DOCUMENT )
{ {
// streams cannot be created as direct children of document root // streams cannot be created as direct children of document root
@@ -2902,7 +2894,6 @@ ContentProperties::getCreatableContentsInfo() const
} }
else else
{ {
#endif
uno::Sequence< ucb::ContentInfo > aSeq( 2 ); uno::Sequence< ucb::ContentInfo > aSeq( 2 );
// Folder. // Folder.
@@ -2919,9 +2910,7 @@ ContentProperties::getCreatableContentsInfo() const
aSeq.getArray()[ 1 ].Properties = aProps; aSeq.getArray()[ 1 ].Properties = aProps;
return aSeq; return aSeq;
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
} }
#endif
} }
else else
{ {

View File

@@ -26,8 +26,6 @@
#include <com/sun/star/ucb/CommandFailedException.hpp> #include <com/sun/star/ucb/CommandFailedException.hpp>
#include "tdoc_provider.hxx" #include "tdoc_provider.hxx"
#define NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT 1
namespace com { namespace sun { namespace star { namespace com { namespace sun { namespace star {
namespace sdbc { class XRow; } namespace sdbc { class XRow; }
namespace io { class XInputStream; class XOutputStream; } namespace io { class XInputStream; class XOutputStream; }

View File

@@ -47,9 +47,6 @@
transfer - x x - - - transfer - x x - - -
createNewContent - x x - - - createNewContent - x x - - -
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
(*) not supported by streams that are direct children of document
#endif
*************************************************************************/ *************************************************************************/
@@ -346,7 +343,6 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands(
if ( m_aProps.getType() == STREAM ) if ( m_aProps.getType() == STREAM )
{ {
#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
Uri aUri( m_xIdentifier->getContentIdentifier() ); Uri aUri( m_xIdentifier->getContentIdentifier() );
Uri aParentUri( aUri.getParentUri() ); Uri aParentUri( aUri.getParentUri() );
@@ -401,7 +397,6 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands(
}; };
return MAKECMDSEQUENCE( aStreamCommandInfoTable1 ); return MAKECMDSEQUENCE( aStreamCommandInfoTable1 );
} }
#endif
// Stream: Supported commands // Stream: Supported commands