summaryrefslogtreecommitdiff
path: root/comphelper/source/misc
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-08-30 16:50:28 +0200
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-08-30 16:50:28 +0200
commit96e97e546201e5564882098097d9866288fada66 (patch)
tree646aff0f3a1ade6bc3fbd846156ed5c9a4fa231e /comphelper/source/misc
parent23be3a441f7db8495e6cbb64412a066d3fd63ce2 (diff)
parent9e685a7e47924f184d076c43acde64548cb5925d (diff)
mib19: rebase to OOO330m6
Diffstat (limited to 'comphelper/source/misc')
-rw-r--r--comphelper/source/misc/officerestartmanager.cxx4
-rw-r--r--comphelper/source/misc/storagehelper.cxx31
2 files changed, 33 insertions, 2 deletions
diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx
index 974b8d65e7ae..1a98ddfce8da 100644
--- a/comphelper/source/misc/officerestartmanager.cxx
+++ b/comphelper/source/misc/officerestartmanager.cxx
@@ -87,9 +87,9 @@ void SAL_CALL OOfficeRestartManager::requestRestart( const uno::Reference< task:
// if the restart already running there is no need to trigger it again
if ( m_bRestartRequested )
return;
-#ifndef MACOSX
+
m_bRestartRequested = sal_True;
-#endif
+
// the office is still not initialized, no need to terminate, changing the state is enough
if ( !m_bOfficeInitialized )
return;
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index e2557523f674..db5ba71cd876 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -452,5 +452,36 @@ sal_Bool OStorageHelper::IsValidZipEntryFileName(
return sal_True;
}
+// ----------------------------------------------------------------------
+sal_Bool OStorageHelper::PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment )
+{
+ sal_Bool bResult = sal_False;
+ const sal_Int32 nPathLen = aPath.getLength();
+ const sal_Int32 nSegLen = aSegment.getLength();
+
+ if ( nSegLen && nPathLen >= nSegLen )
+ {
+ ::rtl::OUString aEndSegment( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
+ aEndSegment += aSegment;
+
+ ::rtl::OUString aInternalSegment( aEndSegment );
+ aInternalSegment += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
+
+ if ( aPath.indexOf( aInternalSegment ) >= 0 )
+ bResult = sal_True;
+
+ if ( !bResult && !aPath.compareTo( aSegment, nSegLen ) )
+ {
+ if ( nPathLen == nSegLen || aPath.getStr()[nSegLen] == (sal_Unicode)'/' )
+ bResult = sal_True;
+ }
+
+ if ( !bResult && nPathLen > nSegLen && aPath.copy( nPathLen - nSegLen - 1, nSegLen + 1 ).equals( aEndSegment ) )
+ bResult = sal_True;
+ }
+
+ return bResult;
+}
+
}