summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:45:03 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:45:03 +0000
commit53d50f23228c3acfe75703b51c8832ac48f54270 (patch)
tree7096895bf857cb7cbf08067f96a60279225caa77
parent832f7b267bcc52af248a5e72e6ebda14d92a19ee (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
-rw-r--r--unotools/inc/unotools/configitem.hxx7
-rw-r--r--unotools/inc/unotools/progresshandlerwrap.hxx98
-rw-r--r--unotools/inc/unotools/ucbhelper.hxx11
-rw-r--r--unotools/prj/build.lst4
-rw-r--r--unotools/source/config/configitem.cxx96
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx10
-rw-r--r--unotools/source/ucbhelper/makefile.mk12
-rw-r--r--unotools/source/ucbhelper/progresshandlerwrap.cxx132
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx33
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx6
-rw-r--r--unotools/util/makefile.mk15
11 files changed, 375 insertions, 49 deletions
diff --git a/unotools/inc/unotools/configitem.hxx b/unotools/inc/unotools/configitem.hxx
index edd80e566471..540f66d77f5a 100644
--- a/unotools/inc/unotools/configitem.hxx
+++ b/unotools/inc/unotools/configitem.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: configitem.hxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: jb $ $Date: 2002-12-03 12:29:27 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -163,6 +163,9 @@ namespace utl
com::sun::star::uno::Sequence< com::sun::star::uno::Any>
GetProperties(const com::sun::star::uno::Sequence< rtl::OUString >& rNames);
+ com::sun::star::uno::Sequence< sal_Bool >
+ GetReadOnlyStates(const com::sun::star::uno::Sequence< rtl::OUString >& rNames);
+
sal_Bool PutProperties(
const com::sun::star::uno::Sequence< rtl::OUString >& rNames,
const com::sun::star::uno::Sequence< com::sun::star::uno::Any>& rValues);
diff --git a/unotools/inc/unotools/progresshandlerwrap.hxx b/unotools/inc/unotools/progresshandlerwrap.hxx
new file mode 100644
index 000000000000..b0350c2ad7b5
--- /dev/null
+++ b/unotools/inc/unotools/progresshandlerwrap.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * $RCSfile: progresshandlerwrap.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _UTL_PROGRESSHANDLERWRAP_HXX_
+#define _UTL_PROGRESSHANDLERWRAP_HXX_
+
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UCB_XPROGRESSHANDLER_HPP_
+#include <com/sun/star/ucb/XProgressHandler.hpp>
+#endif
+
+namespace utl
+{
+
+class ProgressHandlerWrap : public ::cppu::WeakImplHelper1< ::com::sun::star::ucb::XProgressHandler >
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > m_xStatusIndicator;
+
+public:
+ ProgressHandlerWrap( ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > xSI );
+
+ // XProgressHandler
+ virtual void SAL_CALL push( const ::com::sun::star::uno::Any& Status )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL update( const ::com::sun::star::uno::Any& Status )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL pop()
+ throw (::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace utl
+
+#endif // _UTL_PROGRESSHANDLERWRAP_HXX_
+
diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx
index e0dae69ae3e2..77b06dd526ce 100644
--- a/unotools/inc/unotools/ucbhelper.hxx
+++ b/unotools/inc/unotools/ucbhelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucbhelper.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mba $ $Date: 2001-09-10 16:33:44 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,8 +101,11 @@ namespace utl
static sal_Bool MoveTo( const String& rSource, const String& rDest, sal_Int32 nNameClash = com::sun::star::ucb::NameClash::ERROR );
static sal_Bool CanMakeFolder( const String& rFolder );
- static sal_Bool MakeFolder( const String& rFolder );
- static sal_Bool MakeFolder( ::ucb::Content& rParent, const String& rTitle, ::ucb::Content& rNewFolder );
+ static sal_Bool MakeFolder( const String& rFolder, sal_Bool bNewOnly = sal_False );
+ static sal_Bool MakeFolder( ::ucb::Content& rParent,
+ const String& rTitle,
+ ::ucb::Content& rNewFolder,
+ sal_Bool bNewOnly = sal_False );
static sal_Bool HasParentFolder( const String& rFolder );
static ULONG GetSize( const String& rContent );
diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst
index c119ece242bb..c77f9d4dec60 100644
--- a/unotools/prj/build.lst
+++ b/unotools/prj/build.lst
@@ -1,8 +1,8 @@
ut unotools : comphelper cppuhelper offuh tools ucbhelper NULL
ut unotools usr1 - all ut_mkout NULL
-ut unotools\source\misc nmake - all ut_misc NULL
+ut unotools\source\misc nmake - all ut_misc ut_config NULL
ut unotools\source\streaming nmake - all ut_streaming NULL
-ut unotools\source\config nmake - all ut_config NULL
+ut unotools\source\config nmake - all ut_config ut_i18n NULL
ut unotools\source\ucbhelper nmake - all ut_ucbhelper NULL
ut unotools\source\processfactory nmake - all ut_procfact NULL
ut unotools\source\i18n nmake - all ut_i18n NULL
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index 59905c3fff68..eca98be035a7 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: configitem.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: jb $ $Date: 2002-12-03 12:29:27 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,6 +100,9 @@
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
#include <com/sun/star/beans/PropertyValue.hpp>
#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
#ifndef _COM_SUN_STAR_UTIL_XSTRINGESCAPE_HPP_
#include <com/sun/star/util/XStringEscape.hpp>
@@ -112,6 +115,8 @@
#include <osl/diagnose.h>
#endif
+#include <rtl/ustrbuf.hxx>
+
using namespace utl;
using rtl::OUString;
using rtl::OString;
@@ -559,6 +564,91 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString >
}
}
}
+/* -----------------------------03.02.2003 14:44------------------------------
+
+ ---------------------------------------------------------------------------*/
+Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Sequence< rtl::OUString >& rNames)
+{
+ // size of return list is fix!
+ // Every item must match to length of incoming name list.
+ sal_Int32 nCount = rNames.getLength();
+ Sequence< sal_Bool > lStates(nCount);
+
+ // We must be shure to return a valid information everytime!
+ // Set default to non readonly ... similar to the configuration handling of this property.
+ for (sal_Int32 i=0; i<nCount; ++i)
+ lStates[i] = sal_False;
+
+ // no access - no informations ...
+ Reference< XHierarchicalNameAccess > xHierarchyAccess = GetTree();
+ if (!xHierarchyAccess.is())
+ return lStates;
+
+ for (i=0; i<nCount; ++i)
+ {
+ try
+ {
+ if(pImpl->pManager->IsLocalConfigProvider() && lcl_IsLocalProperty(sSubTree, rNames[i]))
+ {
+ OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nlocal mode seams to be used!?\n");
+ continue;
+ }
+
+ OUString sName = rNames[i];
+ OUString sPath;
+ OUString sProperty;
+
+ ::utl::splitLastFromConfigurationPath(sName,sPath,sProperty);
+ if (!sPath.getLength() && !sProperty.getLength())
+ {
+ OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nsplitt failed\n");
+ continue;
+ }
+
+ Reference< XInterface > xNode;
+ Reference< XPropertySet > xSet ;
+ Reference< XPropertySetInfo > xInfo;
+ if (sPath.getLength())
+ {
+ Any aNode = xHierarchyAccess->getByHierarchicalName(sPath);
+ if (!(aNode >>= xNode) || !xNode.is())
+ {
+ OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nno set available\n");
+ continue;
+ }
+ }
+ else
+ {
+ xNode = Reference< XInterface >(xHierarchyAccess, UNO_QUERY);
+ }
+
+ xSet = Reference< XPropertySet >(xNode, UNO_QUERY);
+ if (xSet.is())
+ {
+ xInfo = xSet->getPropertySetInfo();
+ OSL_ENSURE(xInfo.is(), "ConfigItem::IsReadonly()\ngetPropertySetInfo failed ...\n");
+ }
+ else
+ {
+ xInfo = Reference< XPropertySetInfo >(xNode, UNO_QUERY);
+ OSL_ENSURE(xInfo.is(), "ConfigItem::IsReadonly()\nUNO_QUERY failed ...\n");
+ }
+
+ if (!xInfo.is())
+ {
+ OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nno prop info available\n");
+ continue;
+ }
+
+ Property aProp = xInfo->getPropertyByName(sProperty);
+ lStates[i] = ((aProp.Attributes & PropertyAttribute::READONLY) == PropertyAttribute::READONLY);
+ }
+ catch(Exception&){}
+ }
+
+ return lStates;
+}
+
/* -----------------------------29.08.00 15:10--------------------------------
---------------------------------------------------------------------------*/
@@ -1391,3 +1481,5 @@ void ConfigItem::UnlockTree()
m_xHierarchyAccess = 0;
}
+
+
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 5b243830c2e0..8f05c2d08e79 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: localedatawrapper.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: er $ $Date: 2002-09-18 14:41:53 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -486,6 +486,12 @@ void LocaleDataWrapper::invalidateData()
DBG_ERRORFILE( aMsg.GetBuffer() );
}
#endif
+ switch ( eLang )
+ {
+ case LANGUAGE_NORWEGIAN : // no_NO, not Bokmal (nb_NO), not Nynorsk (nn_NO)
+ eLang = LANGUAGE_DONTKNOW; // don't offer "Unknown" language
+ break;
+ }
if ( eLang != LANGUAGE_DONTKNOW )
{
String aLanguage, aCountry;
diff --git a/unotools/source/ucbhelper/makefile.mk b/unotools/source/ucbhelper/makefile.mk
index 0ed474f7a3e4..868e99917577 100644
--- a/unotools/source/ucbhelper/makefile.mk
+++ b/unotools/source/ucbhelper/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.10 $
+# $Revision: 1.11 $
#
-# last change: $Author: mh $ $Date: 2001-11-06 21:09:39 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:39:52 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -69,6 +69,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings common for the whole project -----
+#UNOTYPES=
#.INCLUDE : $(PRJINC)$/unotools$/unotools.mk
# --- Settings ----------------------------------
@@ -85,8 +86,8 @@ ENABLE_EXCEPTIONS=TRUE
# --- Types -------------------------------------
-UNOTYPES+= \
- com.sun.star.sdbc.XRow
+#UNOTYPES+= \
+# com.sun.star.container.XInputStream
# --- Files -------------------------------------
@@ -97,7 +98,8 @@ SLOFILES=\
$(SLO)$/ucbhelper.obj \
$(SLO)$/ucbstreamhelper.obj \
$(SLO)$/tempfile.obj \
- $(SLO)$/xtempfile.obj
+ $(SLO)$/xtempfile.obj \
+ $(SLO)$/progresshandlerwrap.obj
# --- Targets ----------------------------------
diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx
new file mode 100644
index 000000000000..a1ecbb3d2d8f
--- /dev/null
+++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: progresshandlerwrap.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _UTL_PROGRESSHANDLERWRAP_HXX_
+#include <unotools/progresshandlerwrap.hxx>
+#endif
+
+namespace utl
+{
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::ucb;
+
+ProgressHandlerWrap::ProgressHandlerWrap( ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > xSI )
+: m_xStatusIndicator( xSI )
+{
+}
+
+sal_Bool getStatusFromAny_Impl( const Any& aAny, ::rtl::OUString& aText, sal_Int32& nNum )
+{
+ sal_Bool bNumIsSet = sal_False;
+
+ Sequence< Any > aSetList;
+ if( ( aAny >>= aSetList ) && aSetList.getLength() )
+ for( int ind = 0; ind < aSetList.getLength(); ind++ )
+ {
+ if( !bNumIsSet && ( aSetList[ind] >>= nNum ) )
+ bNumIsSet = sal_True;
+ else
+ !aText.getLength() && ( aSetList[ind] >>= aText );
+ }
+
+ return bNumIsSet;
+}
+
+void SAL_CALL ProgressHandlerWrap::push( const Any& Status )
+ throw( RuntimeException )
+{
+ if( !m_xStatusIndicator.is() )
+ return;
+
+ ::rtl::OUString aText;
+ sal_Int32 nRange;
+
+ if( getStatusFromAny_Impl( Status, aText, nRange ) )
+ m_xStatusIndicator->start( aText, nRange );
+}
+
+void SAL_CALL ProgressHandlerWrap::update( const Any& Status )
+ throw( RuntimeException )
+{
+ if( !m_xStatusIndicator.is() )
+ return;
+
+ ::rtl::OUString aText;
+ sal_Int32 nValue;
+
+ if( getStatusFromAny_Impl( Status, aText, nValue ) )
+ {
+ if( aText.getLength() ) m_xStatusIndicator->setText( aText );
+ m_xStatusIndicator->setValue( nValue );
+ }
+}
+
+void SAL_CALL ProgressHandlerWrap::pop()
+ throw( RuntimeException )
+{
+ if( m_xStatusIndicator.is() )
+ m_xStatusIndicator->end();
+}
+
+} // namespace utl
+
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index f508cd756a51..e53480ff3bc3 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucbhelper.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: mav $ $Date: 2002-12-09 16:29:09 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -588,7 +588,7 @@ sal_Bool UCBContentHelper::CanMakeFolder( const String& rFolder )
// -----------------------------------------------------------------------
-sal_Bool UCBContentHelper::MakeFolder( const String& rFolder )
+sal_Bool UCBContentHelper::MakeFolder( const String& rFolder, sal_Bool bNewOnly )
{
INetURLObject aURL( rFolder );
DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
@@ -600,14 +600,14 @@ sal_Bool UCBContentHelper::MakeFolder( const String& rFolder )
Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > (
xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uui.InteractionHandler") ) ), UNO_QUERY );
if ( Content::create( aURL.GetMainURL( INetURLObject::NO_DECODE ), new CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ), aCnt ) )
- return MakeFolder( aCnt, aTitle, aNew );
+ return MakeFolder( aCnt, aTitle, aNew, bNewOnly );
else
return sal_False;
}
-sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Content& rNew )
+sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Content& rNew, sal_Bool bNewOnly )
{
- sal_Bool bRecover = sal_False;
+ sal_Bool bAlreadyExists = sal_False;
try
{
@@ -653,12 +653,12 @@ sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Cont
{
if ( r.Code == IOErrorCode_ALREADY_EXISTING )
{
- bRecover = sal_True;
+ bAlreadyExists = sal_True;
}
}
catch ( NameClashException& )
{
- bRecover = sal_True;
+ bAlreadyExists = sal_True;
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
{
@@ -670,7 +670,7 @@ sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Cont
{
}
- if( bRecover )
+ if( bAlreadyExists && !bNewOnly )
{
INetURLObject aObj( aCnt.getURL() );
aObj.Append( aTitle );
@@ -806,19 +806,10 @@ sal_Bool UCBContentHelper::Exists( const String& rURL )
::rtl::OUString sIn( sObjectPhysicalName ), sOut;
if ( osl_File_E_None == osl_getFileURLFromSystemPath( sIn.pData, &sOut.pData ) )
{
- ::osl::FileBase::RC eResult = FileBase::E_None;
-
+ // #106526 osl_getDirectoryItem is an existence check
+ // no further osl_getFileStatus call necessary
DirectoryItem aItem;
- if ( FileBase::E_None == DirectoryItem::get( sOut, aItem ) )
- {
- FileStatus aStatus( FileStatusMask_FileName );
- eResult = aItem.getFileStatus( aStatus );
- if ( FileBase::E_NOENT == eResult )
- { // there is no such entry
- return sal_False;
- }
- return sal_True;
- }
+ return (FileBase::E_None == DirectoryItem::get(sOut, aItem));
}
return sal_False;
}
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 383cbea15dc2..c31df0407e5e 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucblockbytes.cxx,v $
*
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: mav $ $Date: 2002-08-15 15:34:27 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:39:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -708,7 +708,7 @@ ErrCode UcbLockBytes::SetSize (ULONG nNewSize)
ULONG nDiff = nNewSize-nSize, nCount=0;
BYTE* pBuffer = new BYTE[ nDiff ];
WriteAt( nSize, pBuffer, nDiff, &nCount );
- delete pBuffer;
+ delete[] pBuffer;
if ( nCount != nDiff )
return ERRCODE_IO_CANTWRITE;
}
diff --git a/unotools/util/makefile.mk b/unotools/util/makefile.mk
index cd6b92222f9f..9a97f00c76de 100644
--- a/unotools/util/makefile.mk
+++ b/unotools/util/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.12 $
+# $Revision: 1.13 $
#
-# last change: $Author: sab $ $Date: 2002-02-14 13:54:46 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:39:55 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -92,14 +92,13 @@ SHL1TARGET=$(TARGET)$(UPD)$(DLLPOSTFIX)
SHL1IMPLIB=iutl
SHL1STDLIBS= \
- $(SALLIB) \
- $(OSLLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
$(UCBHELPERLIB) \
- $(TOOLSLIB)
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(TOOLSLIB) \
+ $(VOSLIB) \
+ $(SALLIB)
SHL1LIBS=$(LIB1TARGET)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def