summaryrefslogtreecommitdiff
path: root/fileaccess
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-02-08 09:18:14 +0100
committersb <sb@openoffice.org>2010-02-08 09:18:14 +0100
commit07b4fe3375e516f4bba9fef195a130b0533170b7 (patch)
tree2d73ab201e756f0a6c4a7ccbbf1585c6b9c4e3cf /fileaccess
parent9052c35863c67ed02f7f2129a3262dadfd74d843 (diff)
parent3c550e9f7bdd8c9f1f75f4148f516ddc94290f92 (diff)
sb118: merged in DEV300_m71
Diffstat (limited to 'fileaccess')
-rw-r--r--fileaccess/source/FileAccess.cxx90
1 files changed, 40 insertions, 50 deletions
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx
index 5d568dc994cb..3f387afe4b4c 100644
--- a/fileaccess/source/FileAccess.cxx
+++ b/fileaccess/source/FileAccess.cxx
@@ -61,7 +61,6 @@
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/ucb/XContentCreator.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
@@ -480,11 +479,7 @@ void OFileAccess::createFolder( const rtl::OUString& NewFolderURL )
ucbhelper::Content aCnt( aURL.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment );
- Reference< XContentCreator > xCreator = Reference< XContentCreator >( aCnt.get(), UNO_QUERY );
- if ( !xCreator.is() )
- return;
-
- Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo();
+ Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo();
sal_Int32 nCount = aInfo.getLength();
if ( nCount == 0 )
return;
@@ -758,56 +753,51 @@ bool OFileAccess::createNewFile( const rtl::OUString & rParentURL,
{
ucbhelper::Content aParentCnt( rParentURL, mxEnvironment );
- Reference< XContentCreator > xCreator
- = Reference< XContentCreator >( aParentCnt.get(), UNO_QUERY );
- if ( xCreator.is() )
- {
- Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo();
- sal_Int32 nCount = aInfo.getLength();
- if ( nCount == 0 )
- return false;
+ Sequence< ContentInfo > aInfo = aParentCnt.queryCreatableContentsInfo();
+ sal_Int32 nCount = aInfo.getLength();
+ if ( nCount == 0 )
+ return false;
- for ( sal_Int32 i = 0; i < nCount; ++i )
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ const ContentInfo & rCurr = aInfo[i];
+ if ( ( rCurr.Attributes
+ & ContentInfoAttribute::KIND_DOCUMENT ) &&
+ ( rCurr.Attributes
+ & ContentInfoAttribute::INSERT_WITH_INPUTSTREAM ) )
{
- const ContentInfo & rCurr = aInfo[i];
- if ( ( rCurr.Attributes
- & ContentInfoAttribute::KIND_DOCUMENT ) &&
- ( rCurr.Attributes
- & ContentInfoAttribute::INSERT_WITH_INPUTSTREAM ) )
- {
- // Make sure the only required bootstrap property is
- // "Title",
- const Sequence< Property > & rProps = rCurr.Properties;
- if ( rProps.getLength() != 1 )
- continue;
+ // Make sure the only required bootstrap property is
+ // "Title",
+ const Sequence< Property > & rProps = rCurr.Properties;
+ if ( rProps.getLength() != 1 )
+ continue;
- if ( !rProps[ 0 ].Name.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "Title" ) ) )
- continue;
+ if ( !rProps[ 0 ].Name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM( "Title" ) ) )
+ continue;
- Sequence<rtl::OUString> aNames(1);
- rtl::OUString* pNames = aNames.getArray();
- pNames[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
- Sequence< Any > aValues(1);
- Any* pValues = aValues.getArray();
- pValues[0] = makeAny( rtl::OUString( rTitle ) );
+ Sequence<rtl::OUString> aNames(1);
+ rtl::OUString* pNames = aNames.getArray();
+ pNames[0] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
+ Sequence< Any > aValues(1);
+ Any* pValues = aValues.getArray();
+ pValues[0] = makeAny( rtl::OUString( rTitle ) );
- try
- {
- ucbhelper::Content aNew;
- if ( aParentCnt.insertNewContent(
- rCurr.Type, aNames, aValues, data, aNew ) )
- return true; // success.
- else
- continue;
- }
- catch ( CommandFailedException const & )
- {
- // Interaction Handler already handled the
- // error that has occured...
+ try
+ {
+ ucbhelper::Content aNew;
+ if ( aParentCnt.insertNewContent(
+ rCurr.Type, aNames, aValues, data, aNew ) )
+ return true; // success.
+ else
continue;
- }
+ }
+ catch ( CommandFailedException const & )
+ {
+ // Interaction Handler already handled the
+ // error that has occured...
+ continue;
}
}
}