summaryrefslogtreecommitdiff
path: root/linguistic/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-03-25 15:25:07 +0000
committerOliver Bolte <obo@openoffice.org>2008-03-25 15:25:07 +0000
commit38f9f7086821259ed6adef2cb7f13ebb65140843 (patch)
tree0e761391709dc6786b2ed602272d05c8b59bd48a /linguistic/source
parent0d628578370f8b08cbcbb98edfef118e7c00acda (diff)
INTEGRATION: CWS tl41_DEV300 (1.22.8); FILE MERGED
2008/02/14 15:48:26 tl 1.22.8.4: #i80286# make dictionaries read-only if not in writeable path 2008/02/14 15:48:03 tl 1.22.8.3: #i80286# make dictionaries read-only if not in writeable path 2008/02/14 15:47:12 tl 1.22.8.2: #i80286# make dictionaries read-only if not in writeable path 2008/02/14 15:31:05 tl 1.22.8.1: #i80286# make dictionaries read-only if not in writeable path
Diffstat (limited to 'linguistic/source')
-rw-r--r--linguistic/source/dicimp.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 7e57d86a6589..3f6878d8207c 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: dicimp.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: ihi $ $Date: 2007-06-07 14:21:55 $
+ * last change: $Author: obo $ $Date: 2008-03-25 16:25:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -240,7 +240,8 @@ DictionaryNeo::DictionaryNeo() :
DictionaryNeo::DictionaryNeo(const OUString &rName,
INT16 nLang, DictionaryType eType,
- const OUString &rMainURL) :
+ const OUString &rMainURL,
+ BOOL bWriteable) :
aDicEvtListeners( GetLinguMutex() ),
aDicName (rName),
aMainURL (rMainURL),
@@ -251,13 +252,11 @@ DictionaryNeo::DictionaryNeo(const OUString &rName,
nDicVersion = -1;
bNeedEntries = TRUE;
bIsModified = bIsActive = FALSE;
- bIsReadonly = FALSE;
+ bIsReadonly = !bWriteable;
if( rMainURL.getLength() > 0 )
{
- BOOL bExists = FALSE;
- bIsReadonly = IsReadOnly( rMainURL, &bExists );
-
+ BOOL bExists = FileExists( rMainURL );
if( !bExists )
{
// save new dictionaries with in 6.0 Format (uses UTF8)
@@ -266,9 +265,11 @@ DictionaryNeo::DictionaryNeo(const OUString &rName,
//! create physical representation of an **empty** dictionary
//! that could be found by the dictionary-list implementation
// (Note: empty dictionaries are not just empty files!)
- saveEntries( rMainURL );
+ DBG_ASSERT( !bIsReadonly,
+ "DictionaryNeo: dictionaries should be writeable if they are to be saved" );
+ if (!bIsReadonly)
+ saveEntries( rMainURL );
bNeedEntries = FALSE;
- bIsReadonly = IsReadOnly( rMainURL ); // will be FALSE if saveEntries was succesfull
}
}
else