From a45763c8d12a937baa658a698847a7eca26ecd63 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Tue, 27 Apr 2004 15:08:42 +0000 Subject: INTEGRATION: CWS tl01 (1.19.4); FILE MERGED 2004/01/29 21:29:29 gt 1.19.4.2: RESYNC: (1.19-1.20); FILE MERGED 2003/07/25 13:18:52 tl 1.19.4.1: #110762# API for Hangul/Hanja text conversion user-dictionaries --- linguistic/source/misc.cxx | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 35052820eaaf..10c8823186bb 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: misc.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: rt $ $Date: 2003-12-01 16:20:44 $ + * last change: $Author: obo $ $Date: 2004-04-27 16:08:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,7 +77,13 @@ #ifndef _SVTOOLS_LNGMISC_HXX_ #include #endif +#ifndef _UCBHELPER_CONTENT_HXX +#include +#endif +#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_ +#include +#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include #endif @@ -413,6 +419,38 @@ uno::Sequence< INT16 > /////////////////////////////////////////////////////////////////////////// +BOOL IsReadOnly( const String &rURL, BOOL *pbExist ) +{ + BOOL bRes = FALSE; + BOOL bExists = FALSE; + + if (rURL.Len() > 0) + { + try + { + Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv; + ::ucb::Content aContent( rURL, xCmdEnv ); + + bExists = aContent.isDocument(); + if (bExists) + { + Any aAny( aContent.getPropertyValue( A2OU( "IsReadOnly" ) ) ); + aAny >>= bRes; + } + } + catch (Exception &) + { + bRes = TRUE; + } + } + + if (pbExist) + *pbExist = bExists; + return bRes; +} + +/////////////////////////////////////////////////////////////////////////// + static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, Reference< XHyphenatedWord > &rxHyphWord ) -- cgit