linguistic: sal_Bool->bool
Change-Id: Ifed60967edd768b16cafba3c2293149610138213
This commit is contained in:
@@ -342,11 +342,11 @@ public:
|
|||||||
sal_Int16 GetMinLeading() const;
|
sal_Int16 GetMinLeading() const;
|
||||||
sal_Int16 GetMinTrailing() const;
|
sal_Int16 GetMinTrailing() const;
|
||||||
sal_Int16 GetMinWordLength() const;
|
sal_Int16 GetMinWordLength() const;
|
||||||
sal_Bool addLinguServiceEventListener(
|
bool addLinguServiceEventListener(
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
||||||
throw(::com::sun::star::uno::RuntimeException);
|
throw(::com::sun::star::uno::RuntimeException);
|
||||||
sal_Bool removeLinguServiceEventListener(
|
bool removeLinguServiceEventListener(
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
||||||
throw(::com::sun::star::uno::RuntimeException);
|
throw(::com::sun::star::uno::RuntimeException);
|
||||||
|
@@ -123,9 +123,9 @@ void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType )
|
bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType )
|
||||||
{
|
{
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
|
|
||||||
if (rFileURL.isEmpty())
|
if (rFileURL.isEmpty())
|
||||||
return bRes;
|
return bRes;
|
||||||
@@ -166,7 +166,7 @@ ConvDic::ConvDic(
|
|||||||
const OUString &rName,
|
const OUString &rName,
|
||||||
sal_Int16 nLang,
|
sal_Int16 nLang,
|
||||||
sal_Int16 nConvType,
|
sal_Int16 nConvType,
|
||||||
sal_Bool bBiDirectional,
|
bool bBiDirectional,
|
||||||
const OUString &rMainURL) :
|
const OUString &rMainURL) :
|
||||||
aFlushListeners( GetLinguMutex() )
|
aFlushListeners( GetLinguMutex() )
|
||||||
{
|
{
|
||||||
@@ -181,11 +181,11 @@ ConvDic::ConvDic(
|
|||||||
pConvPropType.reset( new PropTypeMap );
|
pConvPropType.reset( new PropTypeMap );
|
||||||
|
|
||||||
nMaxLeftCharCount = nMaxRightCharCount = 0;
|
nMaxLeftCharCount = nMaxRightCharCount = 0;
|
||||||
bMaxCharCountIsValid = sal_True;
|
bMaxCharCountIsValid = true;
|
||||||
|
|
||||||
bNeedEntries = sal_True;
|
bNeedEntries = true;
|
||||||
bIsModified = bIsActive = sal_False;
|
bIsModified = bIsActive = false;
|
||||||
bIsReadonly = sal_False;
|
bIsReadonly = false;
|
||||||
|
|
||||||
if( !rMainURL.isEmpty() )
|
if( !rMainURL.isEmpty() )
|
||||||
{
|
{
|
||||||
@@ -194,7 +194,7 @@ ConvDic::ConvDic(
|
|||||||
|
|
||||||
if( !bExists ) // new empty dictionary
|
if( !bExists ) // new empty dictionary
|
||||||
{
|
{
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
//! create physical representation of an **empty** dictionary
|
//! create physical representation of an **empty** dictionary
|
||||||
//! that could be found by the dictionary-list implementation
|
//! that could be found by the dictionary-list implementation
|
||||||
// (Note: empty dictionaries are not just empty files!)
|
// (Note: empty dictionaries are not just empty files!)
|
||||||
@@ -204,7 +204,7 @@ ConvDic::ConvDic(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,12 +219,12 @@ void ConvDic::Load()
|
|||||||
DBG_ASSERT( !bIsModified, "dictionary is modified. Really do 'Load'?" );
|
DBG_ASSERT( !bIsModified, "dictionary is modified. Really do 'Load'?" );
|
||||||
|
|
||||||
//!! prevent function from being called recursively via HasEntry, AddEntry
|
//!! prevent function from being called recursively via HasEntry, AddEntry
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
ConvDicXMLImport *pImport = new ConvDicXMLImport( this );
|
ConvDicXMLImport *pImport = new ConvDicXMLImport( this );
|
||||||
//!! keep a first reference to ensure the lifetime of the object !!
|
//!! keep a first reference to ensure the lifetime of the object !!
|
||||||
uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY );
|
uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY );
|
||||||
ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries
|
ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries
|
||||||
bIsModified = sal_False;
|
bIsModified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -267,10 +267,10 @@ void ConvDic::Save()
|
|||||||
//!! keep a first(!) reference until everything is done to
|
//!! keep a first(!) reference until everything is done to
|
||||||
//!! ensure the proper lifetime of the object
|
//!! ensure the proper lifetime of the object
|
||||||
uno::Reference< document::XFilter > aRef( (document::XFilter *) pExport );
|
uno::Reference< document::XFilter > aRef( (document::XFilter *) pExport );
|
||||||
sal_Bool bRet = pExport->Export(); // write entries to file
|
bool bRet = pExport->Export(); // write entries to file
|
||||||
DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" );
|
DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" );
|
||||||
if (bRet)
|
if (bRet)
|
||||||
bIsModified = sal_False;
|
bIsModified = false;
|
||||||
}
|
}
|
||||||
DBG_ASSERT( !bIsModified, "dictionary still modified after save. Save failed?" );
|
DBG_ASSERT( !bIsModified, "dictionary still modified after save. Save failed?" );
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ ConvMap::iterator ConvDic::GetEntry( ConvMap &rMap, const OUString &rFirstText,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool ConvDic::HasEntry( const OUString &rLeftText, const OUString &rRightText )
|
bool ConvDic::HasEntry( const OUString &rLeftText, const OUString &rRightText )
|
||||||
{
|
{
|
||||||
if (bNeedEntries)
|
if (bNeedEntries)
|
||||||
Load();
|
Load();
|
||||||
@@ -319,7 +319,7 @@ void ConvDic::AddEntry( const OUString &rLeftText, const OUString &rRightText )
|
|||||||
nMaxRightCharCount = (sal_Int16) rRightText.getLength();
|
nMaxRightCharCount = (sal_Int16) rRightText.getLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
bIsModified = sal_True;
|
bIsModified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -339,8 +339,8 @@ void ConvDic::RemoveEntry( const OUString &rLeftText, const OUString &rRightText
|
|||||||
pFromRight->erase( aRightIt );
|
pFromRight->erase( aRightIt );
|
||||||
}
|
}
|
||||||
|
|
||||||
bIsModified = sal_True;
|
bIsModified = true;
|
||||||
bMaxCharCountIsValid = sal_False;
|
bMaxCharCountIsValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -391,11 +391,11 @@ void SAL_CALL ConvDic::clear( )
|
|||||||
aFromLeft .clear();
|
aFromLeft .clear();
|
||||||
if (pFromRight.get())
|
if (pFromRight.get())
|
||||||
pFromRight->clear();
|
pFromRight->clear();
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
bIsModified = sal_True;
|
bIsModified = true;
|
||||||
nMaxLeftCharCount = 0;
|
nMaxLeftCharCount = 0;
|
||||||
nMaxRightCharCount = 0;
|
nMaxRightCharCount = 0;
|
||||||
bMaxCharCountIsValid = sal_True;
|
bMaxCharCountIsValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -436,19 +436,19 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static sal_Bool lcl_SeqHasEntry(
|
static bool lcl_SeqHasEntry(
|
||||||
const OUString *pSeqStart, // first element to check
|
const OUString *pSeqStart, // first element to check
|
||||||
sal_Int32 nToCheck, // number of elements to check
|
sal_Int32 nToCheck, // number of elements to check
|
||||||
const OUString &rText)
|
const OUString &rText)
|
||||||
{
|
{
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (pSeqStart && nToCheck > 0)
|
if (pSeqStart && nToCheck > 0)
|
||||||
{
|
{
|
||||||
const OUString *pDone = pSeqStart + nToCheck; // one behind last to check
|
const OUString *pDone = pSeqStart + nToCheck; // one behind last to check
|
||||||
while (!bRes && pSeqStart != pDone)
|
while (!bRes && pSeqStart != pDone)
|
||||||
{
|
{
|
||||||
if (*pSeqStart++ == rText)
|
if (*pSeqStart++ == rText)
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bRes;
|
return bRes;
|
||||||
@@ -556,7 +556,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bMaxCharCountIsValid = sal_True;
|
bMaxCharCountIsValid = true;
|
||||||
}
|
}
|
||||||
sal_Int16 nRes = eDirection == ConversionDirection_FROM_LEFT ?
|
sal_Int16 nRes = eDirection == ConversionDirection_FROM_LEFT ?
|
||||||
nMaxLeftCharCount : nMaxRightCharCount;
|
nMaxLeftCharCount : nMaxRightCharCount;
|
||||||
@@ -571,7 +571,7 @@ void SAL_CALL ConvDic::setPropertyType(
|
|||||||
sal_Int16 nPropertyType )
|
sal_Int16 nPropertyType )
|
||||||
throw (container::NoSuchElementException, IllegalArgumentException, RuntimeException, std::exception)
|
throw (container::NoSuchElementException, IllegalArgumentException, RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
sal_Bool bHasElement = HasEntry( rLeftText, rRightText);
|
bool bHasElement = HasEntry( rLeftText, rRightText);
|
||||||
if (!bHasElement)
|
if (!bHasElement)
|
||||||
throw container::NoSuchElementException();
|
throw container::NoSuchElementException();
|
||||||
|
|
||||||
@@ -579,7 +579,7 @@ void SAL_CALL ConvDic::setPropertyType(
|
|||||||
// same PropertyType even if the right text is different...
|
// same PropertyType even if the right text is different...
|
||||||
if (pConvPropType.get())
|
if (pConvPropType.get())
|
||||||
pConvPropType->insert( PropTypeMap::value_type( rLeftText, nPropertyType ) );
|
pConvPropType->insert( PropTypeMap::value_type( rLeftText, nPropertyType ) );
|
||||||
bIsModified = sal_True;
|
bIsModified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -588,7 +588,7 @@ sal_Int16 SAL_CALL ConvDic::getPropertyType(
|
|||||||
const OUString& rRightText )
|
const OUString& rRightText )
|
||||||
throw (container::NoSuchElementException, RuntimeException, std::exception)
|
throw (container::NoSuchElementException, RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
sal_Bool bHasElement = HasEntry( rLeftText, rRightText);
|
bool bHasElement = HasEntry( rLeftText, rRightText);
|
||||||
if (!bHasElement)
|
if (!bHasElement)
|
||||||
throw container::NoSuchElementException();
|
throw container::NoSuchElementException();
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary"
|
#define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary"
|
||||||
|
|
||||||
|
|
||||||
sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType );
|
bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType );
|
||||||
|
|
||||||
struct StrLT
|
struct StrLT
|
||||||
{
|
{
|
||||||
@@ -92,11 +92,11 @@ protected:
|
|||||||
sal_Int16 nConversionType;
|
sal_Int16 nConversionType;
|
||||||
sal_Int16 nMaxLeftCharCount;
|
sal_Int16 nMaxLeftCharCount;
|
||||||
sal_Int16 nMaxRightCharCount;
|
sal_Int16 nMaxRightCharCount;
|
||||||
sal_Bool bMaxCharCountIsValid;
|
bool bMaxCharCountIsValid;
|
||||||
sal_Bool bNeedEntries;
|
bool bNeedEntries;
|
||||||
sal_Bool bIsModified;
|
bool bIsModified;
|
||||||
sal_Bool bIsActive;
|
bool bIsActive;
|
||||||
sal_Bool bIsReadonly;
|
bool bIsReadonly;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
ConvDic(const ConvDic &);
|
ConvDic(const ConvDic &);
|
||||||
@@ -110,7 +110,7 @@ public:
|
|||||||
ConvDic( const OUString &rName,
|
ConvDic( const OUString &rName,
|
||||||
sal_Int16 nLanguage,
|
sal_Int16 nLanguage,
|
||||||
sal_Int16 nConversionType,
|
sal_Int16 nConversionType,
|
||||||
sal_Bool bBiDirectional,
|
bool bBiDirectional,
|
||||||
const OUString &rMainURL);
|
const OUString &rMainURL);
|
||||||
virtual ~ConvDic();
|
virtual ~ConvDic();
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ public:
|
|||||||
static com::sun::star::uno::Sequence< OUString >
|
static com::sun::star::uno::Sequence< OUString >
|
||||||
getSupportedServiceNames_Static() throw();
|
getSupportedServiceNames_Static() throw();
|
||||||
|
|
||||||
sal_Bool HasEntry( const OUString &rLeftText, const OUString &rRightText );
|
bool HasEntry( const OUString &rLeftText, const OUString &rRightText );
|
||||||
void AddEntry( const OUString &rLeftText, const OUString &rRightText );
|
void AddEntry( const OUString &rLeftText, const OUString &rRightText );
|
||||||
void RemoveEntry( const OUString &rLeftText, const OUString &rRightText );
|
void RemoveEntry( const OUString &rLeftText, const OUString &rRightText );
|
||||||
};
|
};
|
||||||
|
@@ -284,7 +284,7 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName )
|
|||||||
::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ),
|
::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ),
|
||||||
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
|
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
|
||||||
comphelper::getProcessComponentContext() );
|
comphelper::getProcessComponentContext() );
|
||||||
aCnt.executeCommand( "delete", makeAny( sal_Bool( sal_True ) ) );
|
aCnt.executeCommand( "delete", makeAny( true ) );
|
||||||
}
|
}
|
||||||
catch( ::com::sun::star::ucb::CommandAbortedException& )
|
catch( ::com::sun::star::ucb::CommandAbortedException& )
|
||||||
{
|
{
|
||||||
@@ -341,7 +341,7 @@ void ConvDicNameContainer::AddConvDics(
|
|||||||
else if ((nLang == LANGUAGE_CHINESE_SIMPLIFIED || nLang == LANGUAGE_CHINESE_TRADITIONAL) &&
|
else if ((nLang == LANGUAGE_CHINESE_SIMPLIFIED || nLang == LANGUAGE_CHINESE_TRADITIONAL) &&
|
||||||
nConvType == ConversionDictionaryType::SCHINESE_TCHINESE)
|
nConvType == ConversionDictionaryType::SCHINESE_TCHINESE)
|
||||||
{
|
{
|
||||||
xDic = new ConvDic( aDicName, nLang, nConvType, sal_False, aURL );
|
xDic = new ConvDic( aDicName, nLang, nConvType, false, aURL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xDic.is())
|
if (xDic.is())
|
||||||
@@ -374,7 +374,7 @@ ConvDicList::ConvDicList() :
|
|||||||
aEvtListeners( GetLinguMutex() )
|
aEvtListeners( GetLinguMutex() )
|
||||||
{
|
{
|
||||||
pNameContainer = 0;
|
pNameContainer = 0;
|
||||||
bDisposing = sal_False;
|
bDisposing = false;
|
||||||
|
|
||||||
pExitListener = new MyAppExitListener( *this );
|
pExitListener = new MyAppExitListener( *this );
|
||||||
xExitListener = pExitListener;
|
xExitListener = pExitListener;
|
||||||
@@ -465,7 +465,7 @@ uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary(
|
|||||||
else if ((nLang == LANGUAGE_CHINESE_SIMPLIFIED || nLang == LANGUAGE_CHINESE_TRADITIONAL) &&
|
else if ((nLang == LANGUAGE_CHINESE_SIMPLIFIED || nLang == LANGUAGE_CHINESE_TRADITIONAL) &&
|
||||||
nConvDicType == ConversionDictionaryType::SCHINESE_TCHINESE)
|
nConvDicType == ConversionDictionaryType::SCHINESE_TCHINESE)
|
||||||
{
|
{
|
||||||
xRes = new ConvDic( rName, nLang, nConvDicType, sal_False, aDicMainURL );
|
xRes = new ConvDic( rName, nLang, nConvDicType, false, aDicMainURL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xRes.is())
|
if (!xRes.is())
|
||||||
@@ -496,12 +496,12 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions(
|
|||||||
uno::Sequence< OUString > aRes( 20 );
|
uno::Sequence< OUString > aRes( 20 );
|
||||||
OUString *pRes = aRes.getArray();
|
OUString *pRes = aRes.getArray();
|
||||||
|
|
||||||
sal_Bool bSupported = sal_False;
|
bool bSupported = false;
|
||||||
sal_Int32 nLen = GetNameContainer().GetCount();
|
sal_Int32 nLen = GetNameContainer().GetCount();
|
||||||
for (sal_Int32 i = 0; i < nLen; ++i)
|
for (sal_Int32 i = 0; i < nLen; ++i)
|
||||||
{
|
{
|
||||||
const uno::Reference< XConversionDictionary > xDic( GetNameContainer().GetByIndex(i) );
|
const uno::Reference< XConversionDictionary > xDic( GetNameContainer().GetByIndex(i) );
|
||||||
sal_Bool bMatch = xDic.is() &&
|
bool bMatch = xDic.is() &&
|
||||||
xDic->getLocale() == rLocale &&
|
xDic->getLocale() == rLocale &&
|
||||||
xDic->getConversionType() == nConversionDictionaryType;
|
xDic->getConversionType() == nConversionDictionaryType;
|
||||||
bSupported |= bMatch;
|
bSupported |= bMatch;
|
||||||
@@ -564,7 +564,7 @@ void SAL_CALL ConvDicList::dispose( )
|
|||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
if (!bDisposing)
|
if (!bDisposing)
|
||||||
{
|
{
|
||||||
bDisposing = sal_True;
|
bDisposing = true;
|
||||||
EventObject aEvtObj( (XConversionDictionaryList *) this );
|
EventObject aEvtObj( (XConversionDictionaryList *) this );
|
||||||
aEvtListeners.disposeAndClear( aEvtObj );
|
aEvtListeners.disposeAndClear( aEvtObj );
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ class ConvDicList :
|
|||||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::
|
||||||
XTerminateListener > xExitListener;
|
XTerminateListener > xExitListener;
|
||||||
|
|
||||||
sal_Bool bDisposing;
|
bool bDisposing;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
ConvDicList( const ConvDicList & );
|
ConvDicList( const ConvDicList & );
|
||||||
|
@@ -289,9 +289,9 @@ void ConvDicXMLRightTextContext_Impl::EndElement()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
sal_Bool ConvDicXMLExport::Export()
|
bool ConvDicXMLExport::Export()
|
||||||
{
|
{
|
||||||
sal_Bool bRet = sal_False;
|
bool bRet = false;
|
||||||
|
|
||||||
uno::Reference< document::XExporter > xExporter( this );
|
uno::Reference< document::XExporter > xExporter( this );
|
||||||
uno::Reference< document::XFilter > xFilter( xExporter, UNO_QUERY );
|
uno::Reference< document::XFilter > xFilter( xExporter, UNO_QUERY );
|
||||||
@@ -328,7 +328,7 @@ sal_uInt32 ConvDicXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum /*eCl
|
|||||||
|
|
||||||
GetDocHandler()->endDocument();
|
GetDocHandler()->endDocument();
|
||||||
|
|
||||||
bSuccess = sal_True;
|
bSuccess = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ class ConvDic;
|
|||||||
class ConvDicXMLExport : public SvXMLExport
|
class ConvDicXMLExport : public SvXMLExport
|
||||||
{
|
{
|
||||||
ConvDic &rDic;
|
ConvDic &rDic;
|
||||||
sal_Bool bSuccess;
|
bool bSuccess;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConvDicXMLExport( ConvDic &rConvDic,
|
ConvDicXMLExport( ConvDic &rConvDic,
|
||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
SvXMLExport ( comphelper::getProcessComponentContext(), "com.sun.star.lingu2.ConvDicXMLExport", rFileName,
|
SvXMLExport ( comphelper::getProcessComponentContext(), "com.sun.star.lingu2.ConvDicXMLExport", rFileName,
|
||||||
::com::sun::star::util::MeasureUnit::CM, rHandler ),
|
::com::sun::star::util::MeasureUnit::CM, rHandler ),
|
||||||
rDic ( rConvDic ),
|
rDic ( rConvDic ),
|
||||||
bSuccess ( sal_False )
|
bSuccess ( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~ConvDicXMLExport()
|
virtual ~ConvDicXMLExport()
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
void _ExportContent() SAL_OVERRIDE;
|
void _ExportContent() SAL_OVERRIDE;
|
||||||
sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) SAL_OVERRIDE;
|
sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) SAL_OVERRIDE;
|
||||||
|
|
||||||
sal_Bool Export();
|
bool Export();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ class ConvDicXMLImport : public SvXMLImport
|
|||||||
|
|
||||||
sal_Int16 nLanguage; // language of the dictionary
|
sal_Int16 nLanguage; // language of the dictionary
|
||||||
sal_Int16 nConversionType; // conversion type the dictionary is used for
|
sal_Int16 nConversionType; // conversion type the dictionary is used for
|
||||||
sal_Bool bSuccess;
|
bool bSuccess;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public:
|
|||||||
{
|
{
|
||||||
nLanguage = LANGUAGE_NONE;
|
nLanguage = LANGUAGE_NONE;
|
||||||
nConversionType = -1;
|
nConversionType = -1;
|
||||||
bSuccess = sal_False;
|
bSuccess = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~ConvDicXMLImport() throw ()
|
virtual ~ConvDicXMLImport() throw ()
|
||||||
@@ -106,7 +106,7 @@ public:
|
|||||||
ConvDic * GetDic() { return pDic; }
|
ConvDic * GetDic() { return pDic; }
|
||||||
sal_Int16 GetLanguage() const { return nLanguage; }
|
sal_Int16 GetLanguage() const { return nLanguage; }
|
||||||
sal_Int16 GetConversionType() const { return nConversionType; }
|
sal_Int16 GetConversionType() const { return nConversionType; }
|
||||||
sal_Bool GetSuccess() const { return bSuccess; }
|
bool GetSuccess() const { return bSuccess; }
|
||||||
|
|
||||||
void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; }
|
void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; }
|
||||||
void SetConversionType( sal_Int16 nType ) { nConversionType = nType; }
|
void SetConversionType( sal_Int16 nType ) { nConversionType = nType; }
|
||||||
|
@@ -80,14 +80,14 @@ static bool getTag(const OString &rLine, const sal_Char *pTagName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNeg )
|
sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, bool &bNeg )
|
||||||
{
|
{
|
||||||
// Sniff the header
|
// Sniff the header
|
||||||
sal_Int16 nDicVersion = DIC_VERSION_DONTKNOW;
|
sal_Int16 nDicVersion = DIC_VERSION_DONTKNOW;
|
||||||
sal_Char pMagicHeader[MAX_HEADER_LENGTH];
|
sal_Char pMagicHeader[MAX_HEADER_LENGTH];
|
||||||
|
|
||||||
nLng = LANGUAGE_NONE;
|
nLng = LANGUAGE_NONE;
|
||||||
bNeg = sal_False;
|
bNeg = false;
|
||||||
|
|
||||||
if (!rpStream.get() || rpStream->GetError())
|
if (!rpStream.get() || rpStream->GetError())
|
||||||
return -1;
|
return -1;
|
||||||
@@ -98,7 +98,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
|
|||||||
if ((rpStream->Read((void *) pMagicHeader, nVerOOo7Len) == nVerOOo7Len) &&
|
if ((rpStream->Read((void *) pMagicHeader, nVerOOo7Len) == nVerOOo7Len) &&
|
||||||
!strcmp(pMagicHeader, pVerOOo7))
|
!strcmp(pMagicHeader, pVerOOo7))
|
||||||
{
|
{
|
||||||
sal_Bool bSuccess;
|
bool bSuccess;
|
||||||
OString aLine;
|
OString aLine;
|
||||||
|
|
||||||
nDicVersion = DIC_VERSION_7;
|
nDicVersion = DIC_VERSION_7;
|
||||||
@@ -107,7 +107,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
|
|||||||
rpStream->ReadLine(aLine);
|
rpStream->ReadLine(aLine);
|
||||||
|
|
||||||
// 2nd line: language all | en-US | pt-BR ...
|
// 2nd line: language all | en-US | pt-BR ...
|
||||||
while (sal_True == (bSuccess = rpStream->ReadLine(aLine)))
|
while ((bSuccess = rpStream->ReadLine(aLine)))
|
||||||
{
|
{
|
||||||
OString aTagValue;
|
OString aTagValue;
|
||||||
|
|
||||||
@@ -128,9 +128,9 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
|
|||||||
if (getTag(aLine, "type: ", aTagValue))
|
if (getTag(aLine, "type: ", aTagValue))
|
||||||
{
|
{
|
||||||
if (aTagValue == "negative")
|
if (aTagValue == "negative")
|
||||||
bNeg = sal_True;
|
bNeg = true;
|
||||||
else
|
else
|
||||||
bNeg = sal_False;
|
bNeg = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aLine.indexOf("---") != -1) // end of header
|
if (aLine.indexOf("---") != -1) // end of header
|
||||||
@@ -173,9 +173,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
|
|||||||
nLng = LANGUAGE_NONE;
|
nLng = LANGUAGE_NONE;
|
||||||
|
|
||||||
// Negative Flag
|
// Negative Flag
|
||||||
sal_Char nTmp;
|
rpStream->ReadCharAsBool( bNeg );
|
||||||
rpStream->ReadChar( nTmp );
|
|
||||||
bNeg = (sal_Bool)nTmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +183,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
|
|||||||
DictionaryNeo::DictionaryNeo(const OUString &rName,
|
DictionaryNeo::DictionaryNeo(const OUString &rName,
|
||||||
sal_Int16 nLang, DictionaryType eType,
|
sal_Int16 nLang, DictionaryType eType,
|
||||||
const OUString &rMainURL,
|
const OUString &rMainURL,
|
||||||
sal_Bool bWriteable) :
|
bool bWriteable) :
|
||||||
aDicEvtListeners( GetLinguMutex() ),
|
aDicEvtListeners( GetLinguMutex() ),
|
||||||
aDicName (rName),
|
aDicName (rName),
|
||||||
aMainURL (rMainURL),
|
aMainURL (rMainURL),
|
||||||
@@ -194,13 +192,13 @@ DictionaryNeo::DictionaryNeo(const OUString &rName,
|
|||||||
{
|
{
|
||||||
nCount = 0;
|
nCount = 0;
|
||||||
nDicVersion = DIC_VERSION_DONTKNOW;
|
nDicVersion = DIC_VERSION_DONTKNOW;
|
||||||
bNeedEntries = sal_True;
|
bNeedEntries = true;
|
||||||
bIsModified = bIsActive = sal_False;
|
bIsModified = bIsActive = false;
|
||||||
bIsReadonly = !bWriteable;
|
bIsReadonly = !bWriteable;
|
||||||
|
|
||||||
if( !rMainURL.isEmpty())
|
if( !rMainURL.isEmpty())
|
||||||
{
|
{
|
||||||
sal_Bool bExists = FileExists( rMainURL );
|
bool bExists = FileExists( rMainURL );
|
||||||
if( !bExists )
|
if( !bExists )
|
||||||
{
|
{
|
||||||
// save new dictionaries with in Format 7 (UTF8 plain text)
|
// save new dictionaries with in Format 7 (UTF8 plain text)
|
||||||
@@ -213,14 +211,14 @@ DictionaryNeo::DictionaryNeo(const OUString &rName,
|
|||||||
"DictionaryNeo: dictionaries should be writeable if they are to be saved" );
|
"DictionaryNeo: dictionaries should be writeable if they are to be saved" );
|
||||||
if (!bIsReadonly)
|
if (!bIsReadonly)
|
||||||
saveEntries( rMainURL );
|
saveEntries( rMainURL );
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// non persistent dictionaries (like IgnoreAllList) should always be writable
|
// non persistent dictionaries (like IgnoreAllList) should always be writable
|
||||||
bIsReadonly = sal_False;
|
bIsReadonly = false;
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +235,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
|
|||||||
DBG_ASSERT(!bIsModified, "lng : dictionary already modified!");
|
DBG_ASSERT(!bIsModified, "lng : dictionary already modified!");
|
||||||
|
|
||||||
// function should only be called once in order to load entries from file
|
// function should only be called once in order to load entries from file
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
|
|
||||||
if (rMainURL.isEmpty())
|
if (rMainURL.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
@@ -263,7 +261,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
|
|||||||
sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1);
|
sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1);
|
||||||
|
|
||||||
// read header
|
// read header
|
||||||
sal_Bool bNegativ;
|
bool bNegativ;
|
||||||
sal_uInt16 nLang;
|
sal_uInt16 nLang;
|
||||||
nDicVersion = ReadDicVersion(pStream, nLang, bNegativ);
|
nDicVersion = ReadDicVersion(pStream, nLang, bNegativ);
|
||||||
if (0 != (nErr = pStream->GetError()))
|
if (0 != (nErr = pStream->GetError()))
|
||||||
@@ -311,7 +309,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
|
|||||||
OUString aText(aWordBuf, rtl_str_getLength(aWordBuf), eEnc);
|
OUString aText(aWordBuf, rtl_str_getLength(aWordBuf), eEnc);
|
||||||
uno::Reference< XDictionaryEntry > xEntry =
|
uno::Reference< XDictionaryEntry > xEntry =
|
||||||
new DicEntry( aText, bNegativ );
|
new DicEntry( aText, bNegativ );
|
||||||
addEntry_Impl( xEntry , sal_True ); //! don't launch events here
|
addEntry_Impl( xEntry, true ); //! don't launch events here
|
||||||
}
|
}
|
||||||
|
|
||||||
pStream->ReadUInt16( nLen );
|
pStream->ReadUInt16( nLen );
|
||||||
@@ -333,18 +331,18 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
|
|||||||
}
|
}
|
||||||
else if (DIC_VERSION_7 == nDicVersion)
|
else if (DIC_VERSION_7 == nDicVersion)
|
||||||
{
|
{
|
||||||
sal_Bool bSuccess;
|
bool bSuccess;
|
||||||
OString aLine;
|
OString aLine;
|
||||||
|
|
||||||
// remaining lines - stock strings (a [==] b)
|
// remaining lines - stock strings (a [==] b)
|
||||||
while (sal_True == (bSuccess = pStream->ReadLine(aLine)))
|
while (true == (bSuccess = pStream->ReadLine(aLine)))
|
||||||
{
|
{
|
||||||
if (aLine[0] == '#') // skip comments
|
if (aLine[0] == '#') // skip comments
|
||||||
continue;
|
continue;
|
||||||
OUString aText = OStringToOUString(aLine, RTL_TEXTENCODING_UTF8);
|
OUString aText = OStringToOUString(aLine, RTL_TEXTENCODING_UTF8);
|
||||||
uno::Reference< XDictionaryEntry > xEntry =
|
uno::Reference< XDictionaryEntry > xEntry =
|
||||||
new DicEntry( aText, eDicType == DictionaryType_NEGATIVE );
|
new DicEntry( aText, eDicType == DictionaryType_NEGATIVE );
|
||||||
addEntry_Impl( xEntry , sal_True ); //! don't launch events here
|
addEntry_Impl( xEntry, true ); //! don't launch events here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +351,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
|
|||||||
// since this routine should be called only initialy (prior to any
|
// since this routine should be called only initialy (prior to any
|
||||||
// modification to be saved) we reset the bIsModified flag here that
|
// modification to be saved) we reset the bIsModified flag here that
|
||||||
// was implicitly set by addEntry_Impl
|
// was implicitly set by addEntry_Impl
|
||||||
bIsModified = sal_False;
|
bIsModified = false;
|
||||||
|
|
||||||
return pStream->GetError();
|
return pStream->GetError();
|
||||||
}
|
}
|
||||||
@@ -514,7 +512,7 @@ void DictionaryNeo::launchEvent(sal_Int16 nEvent,
|
|||||||
|
|
||||||
int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
|
int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
|
||||||
const OUString &rWord2,
|
const OUString &rWord2,
|
||||||
sal_Bool bSimilarOnly)
|
bool bSimilarOnly)
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
@@ -620,8 +618,8 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
|
|||||||
return nRes;
|
return nRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool DictionaryNeo::seekEntry(const OUString &rWord,
|
bool DictionaryNeo::seekEntry(const OUString &rWord,
|
||||||
sal_Int32 *pPos, sal_Bool bSimilarOnly)
|
sal_Int32 *pPos, bool bSimilarOnly)
|
||||||
{
|
{
|
||||||
// look for entry with binary search.
|
// look for entry with binary search.
|
||||||
// return sal_True if found sal_False else.
|
// return sal_True if found sal_False else.
|
||||||
@@ -648,21 +646,21 @@ sal_Bool DictionaryNeo::seekEntry(const OUString &rWord,
|
|||||||
if(nCmp == 0)
|
if(nCmp == 0)
|
||||||
{
|
{
|
||||||
if( pPos ) *pPos = nMidIdx;
|
if( pPos ) *pPos = nMidIdx;
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
else if(nCmp > 0)
|
else if(nCmp > 0)
|
||||||
nLowerIdx = nMidIdx + 1;
|
nLowerIdx = nMidIdx + 1;
|
||||||
else if( nMidIdx == 0 )
|
else if( nMidIdx == 0 )
|
||||||
{
|
{
|
||||||
if( pPos ) *pPos = nLowerIdx;
|
if( pPos ) *pPos = nLowerIdx;
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
nUpperIdx = nMidIdx - 1;
|
nUpperIdx = nMidIdx - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( pPos ) *pPos = nLowerIdx;
|
if( pPos ) *pPos = nLowerIdx;
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DictionaryNeo::isSorted()
|
bool DictionaryNeo::isSorted()
|
||||||
@@ -684,17 +682,17 @@ bool DictionaryNeo::isSorted()
|
|||||||
return bRes;
|
return bRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicEntry,
|
bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicEntry,
|
||||||
sal_Bool bIsLoadEntries)
|
bool bIsLoadEntries)
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
|
|
||||||
if ( bIsLoadEntries || (!bIsReadonly && xDicEntry.is()) )
|
if ( bIsLoadEntries || (!bIsReadonly && xDicEntry.is()) )
|
||||||
{
|
{
|
||||||
sal_Bool bIsNegEntry = xDicEntry->isNegative();
|
bool bIsNegEntry = xDicEntry->isNegative();
|
||||||
sal_Bool bAddEntry = !isFull() &&
|
bool bAddEntry = !isFull() &&
|
||||||
( ( eDicType == DictionaryType_POSITIVE && !bIsNegEntry )
|
( ( eDicType == DictionaryType_POSITIVE && !bIsNegEntry )
|
||||||
|| ( eDicType == DictionaryType_NEGATIVE && bIsNegEntry )
|
|| ( eDicType == DictionaryType_NEGATIVE && bIsNegEntry )
|
||||||
|| ( eDicType == DictionaryType_MIXED ) );
|
|| ( eDicType == DictionaryType_MIXED ) );
|
||||||
@@ -702,12 +700,12 @@ sal_Bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > x
|
|||||||
// look for position to insert entry at
|
// look for position to insert entry at
|
||||||
// if there is already an entry do not insert the new one
|
// if there is already an entry do not insert the new one
|
||||||
sal_Int32 nPos = 0;
|
sal_Int32 nPos = 0;
|
||||||
sal_Bool bFound = sal_False;
|
bool bFound = false;
|
||||||
if (bAddEntry)
|
if (bAddEntry)
|
||||||
{
|
{
|
||||||
bFound = seekEntry( xDicEntry->getDictionaryWord(), &nPos );
|
bFound = seekEntry( xDicEntry->getDictionaryWord(), &nPos );
|
||||||
if (bFound)
|
if (bFound)
|
||||||
bAddEntry = sal_False;
|
bAddEntry = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bAddEntry)
|
if (bAddEntry)
|
||||||
@@ -728,8 +726,8 @@ sal_Bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > x
|
|||||||
|
|
||||||
nCount++;
|
nCount++;
|
||||||
|
|
||||||
bIsModified = sal_True;
|
bIsModified = true;
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
|
|
||||||
if (!bIsLoadEntries)
|
if (!bIsLoadEntries)
|
||||||
launchEvent( DictionaryEventFlags::ADD_ENTRY, xDicEntry );
|
launchEvent( DictionaryEventFlags::ADD_ENTRY, xDicEntry );
|
||||||
@@ -771,16 +769,16 @@ void SAL_CALL DictionaryNeo::setActive( sal_Bool bActivate )
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
if (bIsActive != bActivate)
|
if ((bIsActive ? 1 : 0) != bActivate)
|
||||||
{
|
{
|
||||||
bIsActive = bActivate != 0;
|
bIsActive = bActivate != 0;
|
||||||
sal_Int16 nEvent = bIsActive ?
|
sal_Int16 nEvent = bIsActive ?
|
||||||
DictionaryEventFlags::ACTIVATE_DIC : DictionaryEventFlags::DEACTIVATE_DIC;
|
DictionaryEventFlags::ACTIVATE_DIC : DictionaryEventFlags::DEACTIVATE_DIC;
|
||||||
|
|
||||||
// remove entries from memory if dictionary is deactivated
|
// remove entries from memory if dictionary is deactivated
|
||||||
if (bIsActive == sal_False)
|
if (bIsActive == false)
|
||||||
{
|
{
|
||||||
sal_Bool bIsEmpty = nCount == 0;
|
bool bIsEmpty = nCount == 0;
|
||||||
|
|
||||||
// save entries first if necessary
|
// save entries first if necessary
|
||||||
if (bIsModified && hasLocation() && !isReadonly())
|
if (bIsModified && hasLocation() && !isReadonly())
|
||||||
@@ -831,7 +829,7 @@ void SAL_CALL DictionaryNeo::setLocale( const Locale& aLocale )
|
|||||||
if (!bIsReadonly && nLanguage != nLanguageP)
|
if (!bIsReadonly && nLanguage != nLanguageP)
|
||||||
{
|
{
|
||||||
nLanguage = nLanguageP;
|
nLanguage = nLanguageP;
|
||||||
bIsModified = sal_True; // new language needs to be saved with dictionary
|
bIsModified = true; // new language needs to be saved with dictionary
|
||||||
|
|
||||||
launchEvent( DictionaryEventFlags::CHG_LANGUAGE, NULL );
|
launchEvent( DictionaryEventFlags::CHG_LANGUAGE, NULL );
|
||||||
}
|
}
|
||||||
@@ -847,7 +845,7 @@ uno::Reference< XDictionaryEntry > SAL_CALL DictionaryNeo::getEntry(
|
|||||||
loadEntries( aMainURL );
|
loadEntries( aMainURL );
|
||||||
|
|
||||||
sal_Int32 nPos;
|
sal_Int32 nPos;
|
||||||
sal_Bool bFound = seekEntry( aWord, &nPos, sal_True );
|
bool bFound = seekEntry( aWord, &nPos, true );
|
||||||
DBG_ASSERT( nCount <= aEntries.getLength(), "lng : wrong number of entries");
|
DBG_ASSERT( nCount <= aEntries.getLength(), "lng : wrong number of entries");
|
||||||
DBG_ASSERT(!bFound || nPos < nCount, "lng : index out of range");
|
DBG_ASSERT(!bFound || nPos < nCount, "lng : index out of range");
|
||||||
|
|
||||||
@@ -861,7 +859,7 @@ sal_Bool SAL_CALL DictionaryNeo::addEntry(
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
|
|
||||||
if (!bIsReadonly)
|
if (!bIsReadonly)
|
||||||
{
|
{
|
||||||
@@ -880,7 +878,7 @@ sal_Bool SAL_CALL
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
|
|
||||||
if (!bIsReadonly)
|
if (!bIsReadonly)
|
||||||
{
|
{
|
||||||
@@ -917,7 +915,7 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord )
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRemoved = sal_False;
|
bool bRemoved = false;
|
||||||
|
|
||||||
if (!bIsReadonly)
|
if (!bIsReadonly)
|
||||||
{
|
{
|
||||||
@@ -925,7 +923,7 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord )
|
|||||||
loadEntries( aMainURL );
|
loadEntries( aMainURL );
|
||||||
|
|
||||||
sal_Int32 nPos;
|
sal_Int32 nPos;
|
||||||
sal_Bool bFound = seekEntry( aWord, &nPos );
|
bool bFound = seekEntry( aWord, &nPos );
|
||||||
DBG_ASSERT( nCount < aEntries.getLength(),
|
DBG_ASSERT( nCount < aEntries.getLength(),
|
||||||
"lng : wrong number of entries");
|
"lng : wrong number of entries");
|
||||||
DBG_ASSERT(!bFound || nPos < nCount, "lng : index out of range");
|
DBG_ASSERT(!bFound || nPos < nCount, "lng : index out of range");
|
||||||
@@ -942,7 +940,7 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord )
|
|||||||
|
|
||||||
//! the following call reduces the length of the sequence by 1 also
|
//! the following call reduces the length of the sequence by 1 also
|
||||||
lcl_SequenceRemoveElementAt( aEntries, nPos );
|
lcl_SequenceRemoveElementAt( aEntries, nPos );
|
||||||
bRemoved = bIsModified = sal_True;
|
bRemoved = bIsModified = true;
|
||||||
|
|
||||||
launchEvent( DictionaryEventFlags::DEL_ENTRY, xDicEntry );
|
launchEvent( DictionaryEventFlags::DEL_ENTRY, xDicEntry );
|
||||||
}
|
}
|
||||||
@@ -987,8 +985,8 @@ void SAL_CALL DictionaryNeo::clear( )
|
|||||||
aEntries = uno::Sequence< uno::Reference< XDictionaryEntry > > ( 32 );
|
aEntries = uno::Sequence< uno::Reference< XDictionaryEntry > > ( 32 );
|
||||||
|
|
||||||
nCount = 0;
|
nCount = 0;
|
||||||
bNeedEntries = sal_False;
|
bNeedEntries = false;
|
||||||
bIsModified = sal_True;
|
bIsModified = true;
|
||||||
|
|
||||||
launchEvent( DictionaryEventFlags::ENTRIES_CLEARED , NULL );
|
launchEvent( DictionaryEventFlags::ENTRIES_CLEARED , NULL );
|
||||||
}
|
}
|
||||||
@@ -1000,7 +998,7 @@ sal_Bool SAL_CALL DictionaryNeo::addDictionaryEventListener(
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (xListener.is())
|
if (xListener.is())
|
||||||
{
|
{
|
||||||
sal_Int32 nLen = aDicEvtListeners.getLength();
|
sal_Int32 nLen = aDicEvtListeners.getLength();
|
||||||
@@ -1015,7 +1013,7 @@ sal_Bool SAL_CALL DictionaryNeo::removeDictionaryEventListener(
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (xListener.is())
|
if (xListener.is())
|
||||||
{
|
{
|
||||||
sal_Int32 nLen = aDicEvtListeners.getLength();
|
sal_Int32 nLen = aDicEvtListeners.getLength();
|
||||||
@@ -1055,7 +1053,7 @@ void SAL_CALL DictionaryNeo::store()
|
|||||||
if (bIsModified && hasLocation() && !isReadonly())
|
if (bIsModified && hasLocation() && !isReadonly())
|
||||||
{
|
{
|
||||||
if (!saveEntries( aMainURL ))
|
if (!saveEntries( aMainURL ))
|
||||||
bIsModified = sal_False;
|
bIsModified = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1069,7 +1067,7 @@ void SAL_CALL DictionaryNeo::storeAsURL(
|
|||||||
if (!saveEntries( aURL ))
|
if (!saveEntries( aURL ))
|
||||||
{
|
{
|
||||||
aMainURL = aURL;
|
aMainURL = aURL;
|
||||||
bIsModified = sal_False;
|
bIsModified = false;
|
||||||
bIsReadonly = IsReadOnly( getLocation() );
|
bIsReadonly = IsReadOnly( getLocation() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1085,14 +1083,14 @@ void SAL_CALL DictionaryNeo::storeToURL(
|
|||||||
|
|
||||||
|
|
||||||
DicEntry::DicEntry(const OUString &rDicFileWord,
|
DicEntry::DicEntry(const OUString &rDicFileWord,
|
||||||
sal_Bool bIsNegativWord)
|
bool bIsNegativWord)
|
||||||
{
|
{
|
||||||
if (!rDicFileWord.isEmpty())
|
if (!rDicFileWord.isEmpty())
|
||||||
splitDicFileWord( rDicFileWord, aDicWord, aReplacement );
|
splitDicFileWord( rDicFileWord, aDicWord, aReplacement );
|
||||||
bIsNegativ = bIsNegativWord;
|
bIsNegativ = bIsNegativWord;
|
||||||
}
|
}
|
||||||
|
|
||||||
DicEntry::DicEntry(const OUString &rDicWord, sal_Bool bNegativ,
|
DicEntry::DicEntry(const OUString &rDicWord, bool bNegativ,
|
||||||
const OUString &rRplcText) :
|
const OUString &rRplcText) :
|
||||||
aDicWord (rDicWord),
|
aDicWord (rDicWord),
|
||||||
aReplacement (rRplcText),
|
aReplacement (rRplcText),
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#define DIC_MAX_ENTRIES 30000
|
#define DIC_MAX_ENTRIES 30000
|
||||||
|
|
||||||
sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNeg );
|
sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, bool &bNeg );
|
||||||
|
|
||||||
class DictionaryNeo :
|
class DictionaryNeo :
|
||||||
public ::cppu::WeakImplHelper2
|
public ::cppu::WeakImplHelper2
|
||||||
@@ -48,16 +48,16 @@ class DictionaryNeo :
|
|||||||
::com::sun::star::uno::Sequence<
|
::com::sun::star::uno::Sequence<
|
||||||
::com::sun::star::uno::Reference<
|
::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XDictionaryEntry > > aEntries;
|
::com::sun::star::linguistic2::XDictionaryEntry > > aEntries;
|
||||||
OUString aDicName;
|
OUString aDicName;
|
||||||
OUString aMainURL;
|
OUString aMainURL;
|
||||||
::com::sun::star::linguistic2::DictionaryType eDicType;
|
::com::sun::star::linguistic2::DictionaryType eDicType;
|
||||||
sal_Int16 nCount;
|
sal_Int16 nCount;
|
||||||
sal_Int16 nLanguage;
|
sal_Int16 nLanguage;
|
||||||
sal_Int16 nDicVersion;
|
sal_Int16 nDicVersion;
|
||||||
sal_Bool bNeedEntries;
|
bool bNeedEntries;
|
||||||
sal_Bool bIsModified;
|
bool bIsModified;
|
||||||
sal_Bool bIsActive;
|
bool bIsActive;
|
||||||
sal_Bool bIsReadonly;
|
bool bIsReadonly;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
DictionaryNeo(const DictionaryNeo &);
|
DictionaryNeo(const DictionaryNeo &);
|
||||||
@@ -71,20 +71,20 @@ class DictionaryNeo :
|
|||||||
sal_uLong saveEntries(const OUString &rMainURL);
|
sal_uLong saveEntries(const OUString &rMainURL);
|
||||||
int cmpDicEntry(const OUString &rWord1,
|
int cmpDicEntry(const OUString &rWord1,
|
||||||
const OUString &rWord2,
|
const OUString &rWord2,
|
||||||
sal_Bool bSimilarOnly = sal_False);
|
bool bSimilarOnly = false);
|
||||||
sal_Bool seekEntry(const OUString &rWord, sal_Int32 *pPos,
|
bool seekEntry(const OUString &rWord, sal_Int32 *pPos,
|
||||||
sal_Bool bSimilarOnly = sal_False);
|
bool bSimilarOnly = false);
|
||||||
bool isSorted();
|
bool isSorted();
|
||||||
|
|
||||||
sal_Bool addEntry_Impl(const ::com::sun::star::uno::Reference<
|
bool addEntry_Impl(const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XDictionaryEntry > xDicEntry,
|
::com::sun::star::linguistic2::XDictionaryEntry > xDicEntry,
|
||||||
sal_Bool bIsLoadEntries = sal_False);
|
bool bIsLoadEntries = false);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DictionaryNeo(const OUString &rName, sal_Int16 nLang,
|
DictionaryNeo(const OUString &rName, sal_Int16 nLang,
|
||||||
::com::sun::star::linguistic2::DictionaryType eType,
|
::com::sun::star::linguistic2::DictionaryType eType,
|
||||||
const OUString &rMainURL,
|
const OUString &rMainURL,
|
||||||
sal_Bool bWriteable );
|
bool bWriteable );
|
||||||
virtual ~DictionaryNeo();
|
virtual ~DictionaryNeo();
|
||||||
|
|
||||||
// XNamed
|
// XNamed
|
||||||
@@ -187,7 +187,7 @@ class DicEntry :
|
|||||||
{
|
{
|
||||||
OUString aDicWord, // including hyphen positions represented by "="
|
OUString aDicWord, // including hyphen positions represented by "="
|
||||||
aReplacement; // including hyphen positions represented by "="
|
aReplacement; // including hyphen positions represented by "="
|
||||||
sal_Bool bIsNegativ;
|
bool bIsNegativ;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
DicEntry(const DicEntry &);
|
DicEntry(const DicEntry &);
|
||||||
@@ -198,8 +198,8 @@ class DicEntry :
|
|||||||
OUString &rReplacement);
|
OUString &rReplacement);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DicEntry(const OUString &rDicFileWord, sal_Bool bIsNegativ);
|
DicEntry(const OUString &rDicFileWord, bool bIsNegativ);
|
||||||
DicEntry(const OUString &rDicWord, sal_Bool bIsNegativ,
|
DicEntry(const OUString &rDicWord, bool bIsNegativ,
|
||||||
const OUString &rRplcText);
|
const OUString &rRplcText);
|
||||||
virtual ~DicEntry();
|
virtual ~DicEntry();
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ using namespace linguistic;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg );
|
static bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, bool& bNeg );
|
||||||
|
|
||||||
static void AddInternal( const uno::Reference< XDictionary > &rDic,
|
static void AddInternal( const uno::Reference< XDictionary > &rDic,
|
||||||
const OUString& rNew );
|
const OUString& rNew );
|
||||||
@@ -90,10 +90,10 @@ public:
|
|||||||
// non-UNO functions
|
// non-UNO functions
|
||||||
void DisposeAndClear( const EventObject &rEvtObj );
|
void DisposeAndClear( const EventObject &rEvtObj );
|
||||||
|
|
||||||
sal_Bool AddDicListEvtListener(
|
bool AddDicListEvtListener(
|
||||||
const uno::Reference< XDictionaryListEventListener >& rxListener,
|
const uno::Reference< XDictionaryListEventListener >& rxListener,
|
||||||
sal_Bool bReceiveVerbose );
|
bool bReceiveVerbose );
|
||||||
sal_Bool RemoveDicListEvtListener(
|
bool RemoveDicListEvtListener(
|
||||||
const uno::Reference< XDictionaryListEventListener >& rxListener );
|
const uno::Reference< XDictionaryListEventListener >& rxListener );
|
||||||
sal_Int16 BeginCollectEvents();
|
sal_Int16 BeginCollectEvents();
|
||||||
sal_Int16 EndCollectEvents();
|
sal_Int16 EndCollectEvents();
|
||||||
@@ -208,9 +208,9 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool DicEvtListenerHelper::AddDicListEvtListener(
|
bool DicEvtListenerHelper::AddDicListEvtListener(
|
||||||
const uno::Reference< XDictionaryListEventListener >& xListener,
|
const uno::Reference< XDictionaryListEventListener >& xListener,
|
||||||
sal_Bool /*bReceiveVerbose*/ )
|
bool /*bReceiveVerbose*/ )
|
||||||
{
|
{
|
||||||
DBG_ASSERT( xListener.is(), "empty reference" );
|
DBG_ASSERT( xListener.is(), "empty reference" );
|
||||||
sal_Int32 nCount = aDicListEvtListeners.getLength();
|
sal_Int32 nCount = aDicListEvtListeners.getLength();
|
||||||
@@ -218,7 +218,7 @@ sal_Bool DicEvtListenerHelper::AddDicListEvtListener(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool DicEvtListenerHelper::RemoveDicListEvtListener(
|
bool DicEvtListenerHelper::RemoveDicListEvtListener(
|
||||||
const uno::Reference< XDictionaryListEventListener >& xListener )
|
const uno::Reference< XDictionaryListEventListener >& xListener )
|
||||||
{
|
{
|
||||||
DBG_ASSERT( xListener.is(), "empty reference" );
|
DBG_ASSERT( xListener.is(), "empty reference" );
|
||||||
@@ -287,8 +287,8 @@ DicList::DicList() :
|
|||||||
{
|
{
|
||||||
pDicEvtLstnrHelper = new DicEvtListenerHelper( this );
|
pDicEvtLstnrHelper = new DicEvtListenerHelper( this );
|
||||||
xDicEvtLstnrHelper = pDicEvtLstnrHelper;
|
xDicEvtLstnrHelper = pDicEvtLstnrHelper;
|
||||||
bDisposing = sal_False;
|
bDisposing = false;
|
||||||
bInCreation = sal_False;
|
bInCreation = false;
|
||||||
|
|
||||||
pExitListener = new MyAppExitListener( *this );
|
pExitListener = new MyAppExitListener( *this );
|
||||||
xExitListener = pExitListener;
|
xExitListener = pExitListener;
|
||||||
@@ -304,7 +304,7 @@ DicList::~DicList()
|
|||||||
void DicList::SearchForDictionaries(
|
void DicList::SearchForDictionaries(
|
||||||
DictionaryVec_t&rDicList,
|
DictionaryVec_t&rDicList,
|
||||||
const OUString &rDicDirURL,
|
const OUString &rDicDirURL,
|
||||||
sal_Bool bIsWriteablePath )
|
bool bIsWriteablePath )
|
||||||
{
|
{
|
||||||
osl::MutexGuard aGuard( GetLinguMutex() );
|
osl::MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ void DicList::SearchForDictionaries(
|
|||||||
{
|
{
|
||||||
OUString aURL( pDirCnt[i] );
|
OUString aURL( pDirCnt[i] );
|
||||||
sal_uInt16 nLang = LANGUAGE_NONE;
|
sal_uInt16 nLang = LANGUAGE_NONE;
|
||||||
sal_Bool bNeg = sal_False;
|
bool bNeg = false;
|
||||||
|
|
||||||
if(!::IsVers2OrNewer( aURL, nLang, bNeg ))
|
if(!::IsVers2OrNewer( aURL, nLang, bNeg ))
|
||||||
{
|
{
|
||||||
@@ -328,9 +328,9 @@ void DicList::SearchForDictionaries(
|
|||||||
OUString aExt( aURL.copy(nPos + 1).toAsciiLowerCase() );
|
OUString aExt( aURL.copy(nPos + 1).toAsciiLowerCase() );
|
||||||
|
|
||||||
if (aDCN.equals(aExt)) // negativ
|
if (aDCN.equals(aExt)) // negativ
|
||||||
bNeg = sal_True;
|
bNeg = true;
|
||||||
else if (aDCP.equals(aExt)) // positiv
|
else if (aDCP.equals(aExt)) // positiv
|
||||||
bNeg = sal_False;
|
bNeg = false;
|
||||||
else
|
else
|
||||||
continue; // andere Files
|
continue; // andere Files
|
||||||
}
|
}
|
||||||
@@ -450,12 +450,12 @@ sal_Bool SAL_CALL DicList::addDictionary(
|
|||||||
if (bDisposing)
|
if (bDisposing)
|
||||||
return sal_False;
|
return sal_False;
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (xDictionary.is())
|
if (xDictionary.is())
|
||||||
{
|
{
|
||||||
DictionaryVec_t& rDicList = GetOrCreateDicList();
|
DictionaryVec_t& rDicList = GetOrCreateDicList();
|
||||||
rDicList.push_back( xDictionary );
|
rDicList.push_back( xDictionary );
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
|
|
||||||
// add listener helper to the dictionaries listener lists
|
// add listener helper to the dictionaries listener lists
|
||||||
xDictionary->addDictionaryEventListener( xDicEvtLstnrHelper );
|
xDictionary->addDictionaryEventListener( xDicEvtLstnrHelper );
|
||||||
@@ -472,7 +472,7 @@ sal_Bool SAL_CALL
|
|||||||
if (bDisposing)
|
if (bDisposing)
|
||||||
return sal_False;
|
return sal_False;
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
sal_Int32 nPos = GetDicPos( xDictionary );
|
sal_Int32 nPos = GetDicPos( xDictionary );
|
||||||
if (nPos >= 0)
|
if (nPos >= 0)
|
||||||
{
|
{
|
||||||
@@ -490,7 +490,7 @@ sal_Bool SAL_CALL
|
|||||||
|
|
||||||
// remove element at nPos
|
// remove element at nPos
|
||||||
rDicList.erase( rDicList.begin() + nPos );
|
rDicList.erase( rDicList.begin() + nPos );
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
}
|
}
|
||||||
return bRes;
|
return bRes;
|
||||||
}
|
}
|
||||||
@@ -507,7 +507,7 @@ sal_Bool SAL_CALL DicList::addDictionaryListEventListener(
|
|||||||
|
|
||||||
DBG_ASSERT(!bReceiveVerbose, "lng : not yet supported");
|
DBG_ASSERT(!bReceiveVerbose, "lng : not yet supported");
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (xListener.is()) //! don't add empty references
|
if (xListener.is()) //! don't add empty references
|
||||||
{
|
{
|
||||||
bRes = pDicEvtLstnrHelper->
|
bRes = pDicEvtLstnrHelper->
|
||||||
@@ -525,7 +525,7 @@ sal_Bool SAL_CALL DicList::removeDictionaryListEventListener(
|
|||||||
if (bDisposing)
|
if (bDisposing)
|
||||||
return sal_False;
|
return sal_False;
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if(xListener.is())
|
if(xListener.is())
|
||||||
{
|
{
|
||||||
bRes = pDicEvtLstnrHelper->RemoveDicListEvtListener( xListener );
|
bRes = pDicEvtLstnrHelper->RemoveDicListEvtListener( xListener );
|
||||||
@@ -583,7 +583,7 @@ void SAL_CALL
|
|||||||
|
|
||||||
if (!bDisposing)
|
if (!bDisposing)
|
||||||
{
|
{
|
||||||
bDisposing = sal_True;
|
bDisposing = true;
|
||||||
EventObject aEvtObj( (XDictionaryList *) this );
|
EventObject aEvtObj( (XDictionaryList *) this );
|
||||||
|
|
||||||
aEvtListeners.disposeAndClear( aEvtObj );
|
aEvtListeners.disposeAndClear( aEvtObj );
|
||||||
@@ -645,7 +645,7 @@ void SAL_CALL
|
|||||||
|
|
||||||
void DicList::_CreateDicList()
|
void DicList::_CreateDicList()
|
||||||
{
|
{
|
||||||
bInCreation = sal_True;
|
bInCreation = true;
|
||||||
|
|
||||||
// look for dictionaries
|
// look for dictionaries
|
||||||
const OUString aWriteablePath( GetDictionaryWriteablePath() );
|
const OUString aWriteablePath( GetDictionaryWriteablePath() );
|
||||||
@@ -653,7 +653,7 @@ void DicList::_CreateDicList()
|
|||||||
const OUString *pPaths = aPaths.getConstArray();
|
const OUString *pPaths = aPaths.getConstArray();
|
||||||
for (sal_Int32 i = 0; i < aPaths.getLength(); ++i)
|
for (sal_Int32 i = 0; i < aPaths.getLength(); ++i)
|
||||||
{
|
{
|
||||||
const sal_Bool bIsWriteablePath = (pPaths[i] == aWriteablePath);
|
const bool bIsWriteablePath = (pPaths[i] == aWriteablePath);
|
||||||
SearchForDictionaries( aDicList, pPaths[i], bIsWriteablePath );
|
SearchForDictionaries( aDicList, pPaths[i], bIsWriteablePath );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -695,7 +695,7 @@ void DicList::_CreateDicList()
|
|||||||
|
|
||||||
pDicEvtLstnrHelper->EndCollectEvents();
|
pDicEvtLstnrHelper->EndCollectEvents();
|
||||||
|
|
||||||
bInCreation = sal_False;
|
bInCreation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -854,10 +854,10 @@ static void AddUserData( const uno::Reference< XDictionary > &rDic )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg )
|
static bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, bool& bNeg )
|
||||||
{
|
{
|
||||||
if (rFileURL.isEmpty())
|
if (rFileURL.isEmpty())
|
||||||
return sal_False;
|
return false;
|
||||||
OUString aDIC("dic");
|
OUString aDIC("dic");
|
||||||
OUString aExt;
|
OUString aExt;
|
||||||
sal_Int32 nPos = rFileURL.lastIndexOf( '.' );
|
sal_Int32 nPos = rFileURL.lastIndexOf( '.' );
|
||||||
@@ -865,7 +865,7 @@ static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_
|
|||||||
aExt = rFileURL.copy( nPos + 1 ).toAsciiLowerCase();
|
aExt = rFileURL.copy( nPos + 1 ).toAsciiLowerCase();
|
||||||
|
|
||||||
if (aDIC != aExt)
|
if (aDIC != aExt)
|
||||||
return sal_False;
|
return false;
|
||||||
|
|
||||||
// get stream to be used
|
// get stream to be used
|
||||||
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
|
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
|
||||||
@@ -883,15 +883,15 @@ static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_
|
|||||||
}
|
}
|
||||||
DBG_ASSERT( xStream.is(), "failed to get stream for read" );
|
DBG_ASSERT( xStream.is(), "failed to get stream for read" );
|
||||||
if (!xStream.is())
|
if (!xStream.is())
|
||||||
return sal_False;
|
return false;
|
||||||
|
|
||||||
SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) );
|
SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) );
|
||||||
|
|
||||||
int nDicVersion = ReadDicVersion(pStream, nLng, bNeg);
|
int nDicVersion = ReadDicVersion(pStream, nLng, bNeg);
|
||||||
if (2 == nDicVersion || nDicVersion >= 5)
|
if (2 == nDicVersion || nDicVersion >= 5)
|
||||||
return sal_True;
|
return true;
|
||||||
|
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -68,8 +68,8 @@ class DicList :
|
|||||||
XTerminateListener > xExitListener;
|
XTerminateListener > xExitListener;
|
||||||
MyAppExitListener *pExitListener;
|
MyAppExitListener *pExitListener;
|
||||||
|
|
||||||
sal_Bool bDisposing;
|
bool bDisposing;
|
||||||
sal_Bool bInCreation;
|
bool bInCreation;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
DicList( const DicList & );
|
DicList( const DicList & );
|
||||||
@@ -86,7 +86,7 @@ class DicList :
|
|||||||
void LaunchEvent(sal_Int16 nEvent, com::sun::star::uno::Sequence<
|
void LaunchEvent(sal_Int16 nEvent, com::sun::star::uno::Sequence<
|
||||||
::com::sun::star::linguistic2::XDictionary > xDic);
|
::com::sun::star::linguistic2::XDictionary > xDic);
|
||||||
void SearchForDictionaries( DictionaryVec_t &rDicList,
|
void SearchForDictionaries( DictionaryVec_t &rDicList,
|
||||||
const OUString &rDicDir, sal_Bool bIsWritePath );
|
const OUString &rDicDir, bool bIsWritePath );
|
||||||
sal_Int32 GetDicPos(const com::sun::star::uno::Reference<
|
sal_Int32 GetDicPos(const com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XDictionary > &xDic);
|
::com::sun::star::linguistic2::XDictionary > &xDic);
|
||||||
|
|
||||||
|
@@ -236,9 +236,9 @@ static lang::Locale lcl_GetPrimaryLanguageOfSentence(
|
|||||||
|
|
||||||
|
|
||||||
GrammarCheckingIterator::GrammarCheckingIterator() :
|
GrammarCheckingIterator::GrammarCheckingIterator() :
|
||||||
m_bEnd( sal_False ),
|
m_bEnd( false ),
|
||||||
m_aCurCheckedDocId(),
|
m_aCurCheckedDocId(),
|
||||||
m_bGCServicesChecked( sal_False ),
|
m_bGCServicesChecked( false ),
|
||||||
m_nDocIdCounter( 0 ),
|
m_nDocIdCounter( 0 ),
|
||||||
m_nLastEndOfSentencePos( -1 ),
|
m_nLastEndOfSentencePos( -1 ),
|
||||||
m_aEventListeners( MyMutex::get() ),
|
m_aEventListeners( MyMutex::get() ),
|
||||||
@@ -260,7 +260,7 @@ void GrammarCheckingIterator::TerminateThread()
|
|||||||
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
|
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
|
||||||
t = m_thread;
|
t = m_thread;
|
||||||
m_thread = 0;
|
m_thread = 0;
|
||||||
m_bEnd = sal_True;
|
m_bEnd = true;
|
||||||
m_aWakeUpThread.set();
|
m_aWakeUpThread.set();
|
||||||
}
|
}
|
||||||
if (t != 0)
|
if (t != 0)
|
||||||
@@ -308,7 +308,7 @@ void GrammarCheckingIterator::AddEntry(
|
|||||||
uno::WeakReference< text::XFlatParagraph > xFlatPara,
|
uno::WeakReference< text::XFlatParagraph > xFlatPara,
|
||||||
const OUString & rDocId,
|
const OUString & rDocId,
|
||||||
sal_Int32 nStartIndex,
|
sal_Int32 nStartIndex,
|
||||||
sal_Bool bAutomatic )
|
bool bAutomatic )
|
||||||
{
|
{
|
||||||
// we may not need/have a xFlatParaIterator (e.g. if checkGrammarAtPos was called)
|
// we may not need/have a xFlatParaIterator (e.g. if checkGrammarAtPos was called)
|
||||||
// but we always need a xFlatPara...
|
// but we always need a xFlatPara...
|
||||||
@@ -339,11 +339,11 @@ void GrammarCheckingIterator::ProcessResult(
|
|||||||
{
|
{
|
||||||
DBG_ASSERT( rRes.xFlatParagraph.is(), "xFlatParagraph is missing" );
|
DBG_ASSERT( rRes.xFlatParagraph.is(), "xFlatParagraph is missing" );
|
||||||
//no guard necessary as no members are used
|
//no guard necessary as no members are used
|
||||||
sal_Bool bContinueWithNextPara = sal_False;
|
bool bContinueWithNextPara = false;
|
||||||
if (!rRes.xFlatParagraph.is() || rRes.xFlatParagraph->isModified())
|
if (!rRes.xFlatParagraph.is() || rRes.xFlatParagraph->isModified())
|
||||||
{
|
{
|
||||||
// if paragraph was modified/deleted meanwhile continue with the next one...
|
// if paragraph was modified/deleted meanwhile continue with the next one...
|
||||||
bContinueWithNextPara = sal_True;
|
bContinueWithNextPara = true;
|
||||||
}
|
}
|
||||||
else // paragraph is still unchanged...
|
else // paragraph is still unchanged...
|
||||||
{
|
{
|
||||||
@@ -412,7 +412,7 @@ void GrammarCheckingIterator::ProcessResult(
|
|||||||
if (rRes.xFlatParagraph.is())
|
if (rRes.xFlatParagraph.is())
|
||||||
rRes.xFlatParagraph->setChecked( text::TextMarkupType::PROOFREADING, true );
|
rRes.xFlatParagraph->setChecked( text::TextMarkupType::PROOFREADING, true );
|
||||||
|
|
||||||
bContinueWithNextPara = sal_True;
|
bContinueWithNextPara = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC
|
|||||||
if (!m_bGCServicesChecked)
|
if (!m_bGCServicesChecked)
|
||||||
{
|
{
|
||||||
GetConfiguredGCSvcs_Impl();
|
GetConfiguredGCSvcs_Impl();
|
||||||
m_bGCServicesChecked = sal_True;
|
m_bGCServicesChecked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LanguageType nLang = LanguageTag::convertToLanguageType( rLocale, false);
|
const LanguageType nLang = LanguageTag::convertToLanguageType( rLocale, false);
|
||||||
@@ -527,7 +527,7 @@ void GrammarCheckingIterator::DequeueAndCheck()
|
|||||||
uno::Reference< text::XFlatParagraph > xFlatPara;
|
uno::Reference< text::XFlatParagraph > xFlatPara;
|
||||||
FPEntry aFPEntryItem;
|
FPEntry aFPEntryItem;
|
||||||
OUString aCurDocId;
|
OUString aCurDocId;
|
||||||
sal_Bool bModified = sal_False;
|
bool bModified = false;
|
||||||
// ---- THREAD SAFE START ----
|
// ---- THREAD SAFE START ----
|
||||||
{
|
{
|
||||||
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
|
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
|
||||||
@@ -820,7 +820,7 @@ throw (uno::RuntimeException, std::exception)
|
|||||||
// ---- THREAD SAFE START ----
|
// ---- THREAD SAFE START ----
|
||||||
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
|
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
|
|
||||||
uno::Reference< lang::XComponent > xComponent( xDoc, uno::UNO_QUERY );
|
uno::Reference< lang::XComponent > xComponent( xDoc, uno::UNO_QUERY );
|
||||||
if (xComponent.is())
|
if (xComponent.is())
|
||||||
@@ -837,7 +837,7 @@ throw (uno::RuntimeException, std::exception)
|
|||||||
if (!m_aCurCheckedDocId.isEmpty() && m_aCurCheckedDocId == aDocId)
|
if (!m_aCurCheckedDocId.isEmpty() && m_aCurCheckedDocId == aDocId)
|
||||||
{
|
{
|
||||||
// an entry for that document was dequed and is currently being checked.
|
// an entry for that document was dequed and is currently being checked.
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -848,7 +848,7 @@ throw (uno::RuntimeException, std::exception)
|
|||||||
for (sal_Int32 i = 0; i < nSize && !bRes; ++i)
|
for (sal_Int32 i = 0; i < nSize && !bRes; ++i)
|
||||||
{
|
{
|
||||||
if (aDocId == m_aFPEntriesQueue[i].m_aDocId)
|
if (aDocId == m_aFPEntriesQueue[i].m_aDocId)
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -59,12 +59,12 @@ struct FPEntry
|
|||||||
sal_Int32 m_nStartIndex;
|
sal_Int32 m_nStartIndex;
|
||||||
|
|
||||||
// the flag to identify whether the document does automatical grammar checking
|
// the flag to identify whether the document does automatical grammar checking
|
||||||
sal_Bool m_bAutomatic;
|
bool m_bAutomatic;
|
||||||
|
|
||||||
FPEntry()
|
FPEntry()
|
||||||
: m_aDocId()
|
: m_aDocId()
|
||||||
, m_nStartIndex( 0 )
|
, m_nStartIndex( 0 )
|
||||||
, m_bAutomatic( 0 )
|
, m_bAutomatic( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -91,7 +91,7 @@ class GrammarCheckingIterator:
|
|||||||
FPQueue_t m_aFPEntriesQueue;
|
FPQueue_t m_aFPEntriesQueue;
|
||||||
|
|
||||||
// the flag to end the endless loop
|
// the flag to end the endless loop
|
||||||
sal_Bool m_bEnd;
|
bool m_bEnd;
|
||||||
|
|
||||||
// Note that it must be the pointer and not the uno-reference to check if it is the same implementation object
|
// Note that it must be the pointer and not the uno-reference to check if it is the same implementation object
|
||||||
typedef std::map< XComponent *, OUString > DocMap_t;
|
typedef std::map< XComponent *, OUString > DocMap_t;
|
||||||
@@ -107,7 +107,7 @@ class GrammarCheckingIterator:
|
|||||||
GCReferences_t m_aGCReferencesByService;
|
GCReferences_t m_aGCReferencesByService;
|
||||||
|
|
||||||
OUString m_aCurCheckedDocId;
|
OUString m_aCurCheckedDocId;
|
||||||
sal_Bool m_bGCServicesChecked;
|
bool m_bGCServicesChecked;
|
||||||
sal_Int32 m_nDocIdCounter;
|
sal_Int32 m_nDocIdCounter;
|
||||||
sal_Int32 m_nLastEndOfSentencePos;
|
sal_Int32 m_nLastEndOfSentencePos;
|
||||||
osl::Condition m_aWakeUpThread;
|
osl::Condition m_aWakeUpThread;
|
||||||
@@ -129,7 +129,7 @@ class GrammarCheckingIterator:
|
|||||||
void AddEntry(
|
void AddEntry(
|
||||||
::com::sun::star::uno::WeakReference< ::com::sun::star::text::XFlatParagraphIterator > xFlatParaIterator,
|
::com::sun::star::uno::WeakReference< ::com::sun::star::text::XFlatParagraphIterator > xFlatParaIterator,
|
||||||
::com::sun::star::uno::WeakReference< ::com::sun::star::text::XFlatParagraph > xFlatPara,
|
::com::sun::star::uno::WeakReference< ::com::sun::star::text::XFlatParagraph > xFlatPara,
|
||||||
const OUString &rDocId, sal_Int32 nStartIndex, sal_Bool bAutomatic );
|
const OUString &rDocId, sal_Int32 nStartIndex, bool bAutomatic );
|
||||||
|
|
||||||
void ProcessResult( const ::com::sun::star::linguistic2::ProofreadingResult &rRes,
|
void ProcessResult( const ::com::sun::star::linguistic2::ProofreadingResult &rRes,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFlatParagraphIterator > &rxFlatParagraphIterator,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFlatParagraphIterator > &rxFlatParagraphIterator,
|
||||||
|
@@ -71,13 +71,13 @@ sal_Int16 SAL_CALL checkScriptType(sal_Unicode c) throw (RuntimeException)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType )
|
bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType )
|
||||||
{
|
{
|
||||||
sal_Bool bIsAll = sal_True;
|
bool bIsAll = true;
|
||||||
for (sal_Int32 i = 0; i < rTxt.getLength() && bIsAll; ++i)
|
for (sal_Int32 i = 0; i < rTxt.getLength() && bIsAll; ++i)
|
||||||
{
|
{
|
||||||
if (checkScriptType( rTxt[i]) != nScriptType)
|
if (checkScriptType( rTxt[i]) != nScriptType)
|
||||||
bIsAll = sal_False;
|
bIsAll = false;
|
||||||
}
|
}
|
||||||
return bIsAll;
|
return bIsAll;
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType )
|
|||||||
|
|
||||||
|
|
||||||
HHConvDic::HHConvDic( const OUString &rName, const OUString &rMainURL ) :
|
HHConvDic::HHConvDic( const OUString &rName, const OUString &rMainURL ) :
|
||||||
ConvDic( rName, LANGUAGE_KOREAN, ConversionDictionaryType::HANGUL_HANJA, sal_True, rMainURL )
|
ConvDic( rName, LANGUAGE_KOREAN, ConversionDictionaryType::HANGUL_HANJA, true, rMainURL )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,8 +86,8 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord(
|
|||||||
sal_Int16 nOrigHyphPos = -1;
|
sal_Int16 nOrigHyphPos = -1;
|
||||||
|
|
||||||
OUStringBuffer aTmp( nTextLen );
|
OUStringBuffer aTmp( nTextLen );
|
||||||
sal_Bool bSkip = sal_False;
|
bool bSkip = false;
|
||||||
sal_Bool bSkip2 = sal_False;
|
bool bSkip2 = false;
|
||||||
sal_Int32 nHyphIdx = -1;
|
sal_Int32 nHyphIdx = -1;
|
||||||
sal_Int32 nLeading = 0;
|
sal_Int32 nLeading = 0;
|
||||||
for (sal_Int32 i = 0; i < nTextLen; i++)
|
for (sal_Int32 i = 0; i < nTextLen; i++)
|
||||||
@@ -99,7 +99,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord(
|
|||||||
{
|
{
|
||||||
aTmp.append( cTmp );
|
aTmp.append( cTmp );
|
||||||
nLeading++;
|
nLeading++;
|
||||||
bSkip = sal_False;
|
bSkip = false;
|
||||||
nHyphIdx++;
|
nHyphIdx++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -111,7 +111,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord(
|
|||||||
nOrigHyphPos = i;
|
nOrigHyphPos = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bSkip = sal_True; //! multiple '=' should count as one only
|
bSkip = true; //! multiple '=' should count as one only
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,8 +202,8 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens(
|
|||||||
sal_Int32 nHyphCount = 0;
|
sal_Int32 nHyphCount = 0;
|
||||||
|
|
||||||
OUStringBuffer aTmp( nTextLen );
|
OUStringBuffer aTmp( nTextLen );
|
||||||
sal_Bool bSkip = sal_False;
|
bool bSkip = false;
|
||||||
sal_Bool bSkip2 = sal_False;
|
bool bSkip2 = false;
|
||||||
sal_Int32 nHyphIdx = -1;
|
sal_Int32 nHyphIdx = -1;
|
||||||
for (sal_Int32 i = 0; i < nTextLen; i++)
|
for (sal_Int32 i = 0; i < nTextLen; i++)
|
||||||
{
|
{
|
||||||
@@ -213,14 +213,14 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens(
|
|||||||
if (cTmp != '=' && !bSkip2 && cTmp != ']')
|
if (cTmp != '=' && !bSkip2 && cTmp != ']')
|
||||||
{
|
{
|
||||||
aTmp.append( cTmp );
|
aTmp.append( cTmp );
|
||||||
bSkip = sal_False;
|
bSkip = false;
|
||||||
nHyphIdx++;
|
nHyphIdx++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!bSkip && nHyphIdx >= 0)
|
if (!bSkip && nHyphIdx >= 0)
|
||||||
pPos[ nHyphCount++ ] = (sal_Int16) nHyphIdx;
|
pPos[ nHyphCount++ ] = (sal_Int16) nHyphIdx;
|
||||||
bSkip = sal_True; //! multiple '=' should count as one only
|
bSkip = true; //! multiple '=' should count as one only
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -87,7 +87,7 @@ static void lcl_RemoveAsPropertyChangeListener(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static sal_Bool lcl_IsFlushProperty( sal_Int32 nHandle )
|
static bool lcl_IsFlushProperty( sal_Int32 nHandle )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < NUM_FLUSH_PROPS; ++i)
|
for (i = 0; i < NUM_FLUSH_PROPS; ++i)
|
||||||
@@ -174,7 +174,7 @@ void SAL_CALL FlushListener::processDictionaryListEvent(
|
|||||||
DictionaryListEventFlags::DEL_POS_ENTRY |
|
DictionaryListEventFlags::DEL_POS_ENTRY |
|
||||||
DictionaryListEventFlags::ACTIVATE_NEG_DIC |
|
DictionaryListEventFlags::ACTIVATE_NEG_DIC |
|
||||||
DictionaryListEventFlags::DEACTIVATE_POS_DIC;
|
DictionaryListEventFlags::DEACTIVATE_POS_DIC;
|
||||||
sal_Bool bFlush = 0 != (nEvt & nFlushFlags);
|
bool bFlush = 0 != (nEvt & nFlushFlags);
|
||||||
|
|
||||||
DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" );
|
DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" );
|
||||||
if (bFlush && pFlushObj != NULL)
|
if (bFlush && pFlushObj != NULL)
|
||||||
@@ -191,7 +191,7 @@ void SAL_CALL FlushListener::propertyChange(
|
|||||||
|
|
||||||
if (rEvt.Source == xPropSet)
|
if (rEvt.Source == xPropSet)
|
||||||
{
|
{
|
||||||
sal_Bool bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle );
|
bool bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle );
|
||||||
|
|
||||||
DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" );
|
DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" );
|
||||||
if (bFlush && pFlushObj != NULL)
|
if (bFlush && pFlushObj != NULL)
|
||||||
|
@@ -195,7 +195,7 @@ LinguProps::LinguProps() :
|
|||||||
aPropListeners (GetLinguMutex()),
|
aPropListeners (GetLinguMutex()),
|
||||||
aPropertyMap(lcl_GetLinguProps())
|
aPropertyMap(lcl_GetLinguProps())
|
||||||
{
|
{
|
||||||
bDisposing = sal_False;
|
bDisposing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const
|
void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const
|
||||||
@@ -387,7 +387,7 @@ void SAL_CALL
|
|||||||
|
|
||||||
if (!bDisposing)
|
if (!bDisposing)
|
||||||
{
|
{
|
||||||
bDisposing = sal_True;
|
bDisposing = true;
|
||||||
|
|
||||||
//! its too late to save the options here!
|
//! its too late to save the options here!
|
||||||
// (see AppExitListener for saving)
|
// (see AppExitListener for saving)
|
||||||
@@ -456,10 +456,10 @@ uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static()
|
|||||||
return aSNS;
|
return aSNS;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool LinguProps::getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException)
|
bool LinguProps::getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
uno::Any any = getPropertyValue(aPropertyName);
|
uno::Any any = getPropertyValue(aPropertyName);
|
||||||
sal_Bool b = sal_False;
|
bool b = false;
|
||||||
any >>= b;
|
any >>= b;
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,7 @@ class LinguProps :
|
|||||||
SfxItemPropertyMap aPropertyMap;
|
SfxItemPropertyMap aPropertyMap;
|
||||||
SvtLinguConfig aConfig;
|
SvtLinguConfig aConfig;
|
||||||
|
|
||||||
sal_Bool bDisposing;
|
bool bDisposing;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
LinguProps(const LinguProps &);
|
LinguProps(const LinguProps &);
|
||||||
@@ -93,10 +93,10 @@ class LinguProps :
|
|||||||
|
|
||||||
void launchEvent( const ::com::sun::star::beans::PropertyChangeEvent &rEvt ) const;
|
void launchEvent( const ::com::sun::star::beans::PropertyChangeEvent &rEvt ) const;
|
||||||
|
|
||||||
sal_Bool getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException);
|
bool getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException);
|
||||||
sal_Int16 getPropertyInt16(const OUString& aPropertyName) throw (css::uno::RuntimeException);
|
sal_Int16 getPropertyInt16(const OUString& aPropertyName) throw (css::uno::RuntimeException);
|
||||||
css::lang::Locale getPropertyLocale(const OUString& aPropertyName) throw (css::uno::RuntimeException);
|
css::lang::Locale getPropertyLocale(const OUString& aPropertyName) throw (css::uno::RuntimeException);
|
||||||
void setProperty(const OUString& aPropertyName, sal_Bool p1) throw (css::uno::RuntimeException)
|
void setProperty(const OUString& aPropertyName, bool p1) throw (css::uno::RuntimeException)
|
||||||
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
|
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
|
||||||
void setProperty(const OUString& aPropertyName, sal_Int16 p1) throw (css::uno::RuntimeException)
|
void setProperty(const OUString& aPropertyName, sal_Int16 p1) throw (css::uno::RuntimeException)
|
||||||
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
|
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
|
||||||
@@ -109,23 +109,23 @@ public:
|
|||||||
virtual sal_Bool SAL_CALL getIsUseDictionaryList() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsUseDictionaryList() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_USE_DICTIONARY_LIST); }
|
{ return getPropertyBool(UPN_IS_USE_DICTIONARY_LIST); }
|
||||||
virtual void SAL_CALL setIsUseDictionaryList(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsUseDictionaryList(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_USE_DICTIONARY_LIST, p1); }
|
{ setProperty(UPN_IS_USE_DICTIONARY_LIST, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsIgnoreControlCharacters() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsIgnoreControlCharacters() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_IGNORE_CONTROL_CHARACTERS); }
|
{ return getPropertyBool(UPN_IS_IGNORE_CONTROL_CHARACTERS); }
|
||||||
virtual void SAL_CALL setIsIgnoreControlCharacters(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsIgnoreControlCharacters(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_IGNORE_CONTROL_CHARACTERS, p1); }
|
{ setProperty(UPN_IS_IGNORE_CONTROL_CHARACTERS, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsSpellUpperCase() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsSpellUpperCase() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_SPELL_UPPER_CASE); }
|
{ return getPropertyBool(UPN_IS_SPELL_UPPER_CASE); }
|
||||||
virtual void SAL_CALL setIsSpellUpperCase(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsSpellUpperCase(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_SPELL_UPPER_CASE, p1); }
|
{ setProperty(UPN_IS_SPELL_UPPER_CASE, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsSpellWithDigits() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsSpellWithDigits() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_SPELL_WITH_DIGITS); }
|
{ return getPropertyBool(UPN_IS_SPELL_WITH_DIGITS); }
|
||||||
virtual void SAL_CALL setIsSpellWithDigits(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsSpellWithDigits(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_SPELL_WITH_DIGITS, p1); }
|
{ setProperty(UPN_IS_SPELL_WITH_DIGITS, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsSpellCapitalization() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsSpellCapitalization() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_SPELL_CAPITALIZATION); }
|
{ return getPropertyBool(UPN_IS_SPELL_CAPITALIZATION); }
|
||||||
virtual void SAL_CALL setIsSpellCapitalization(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsSpellCapitalization(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_SPELL_CAPITALIZATION, p1); }
|
{ setProperty(UPN_IS_SPELL_CAPITALIZATION, (bool) p1); }
|
||||||
virtual sal_Int16 SAL_CALL getHyphMinLeading() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Int16 SAL_CALL getHyphMinLeading() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyInt16(UPN_HYPH_MIN_LEADING); }
|
{ return getPropertyInt16(UPN_HYPH_MIN_LEADING); }
|
||||||
virtual void SAL_CALL setHyphMinLeading(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setHyphMinLeading(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
@@ -145,23 +145,23 @@ public:
|
|||||||
virtual sal_Bool SAL_CALL getIsHyphAuto() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsHyphAuto() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_HYPH_AUTO); }
|
{ return getPropertyBool(UPN_IS_HYPH_AUTO); }
|
||||||
virtual void SAL_CALL setIsHyphAuto(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsHyphAuto(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_HYPH_AUTO, p1); }
|
{ setProperty(UPN_IS_HYPH_AUTO, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsHyphSpecial() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsHyphSpecial() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_HYPH_SPECIAL); }
|
{ return getPropertyBool(UPN_IS_HYPH_SPECIAL); }
|
||||||
virtual void SAL_CALL setIsHyphSpecial(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsHyphSpecial(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_HYPH_SPECIAL, p1); }
|
{ setProperty(UPN_IS_HYPH_SPECIAL, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsSpellAuto() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsSpellAuto() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_SPELL_AUTO); }
|
{ return getPropertyBool(UPN_IS_SPELL_AUTO); }
|
||||||
virtual void SAL_CALL setIsSpellAuto(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsSpellAuto(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_SPELL_AUTO, p1); }
|
{ setProperty(UPN_IS_SPELL_AUTO, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsSpellSpecial() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsSpellSpecial() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_SPELL_SPECIAL); }
|
{ return getPropertyBool(UPN_IS_SPELL_SPECIAL); }
|
||||||
virtual void SAL_CALL setIsSpellSpecial(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsSpellSpecial(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_SPELL_SPECIAL, p1); }
|
{ setProperty(UPN_IS_SPELL_SPECIAL, (bool) p1); }
|
||||||
virtual sal_Bool SAL_CALL getIsWrapReverse() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual sal_Bool SAL_CALL getIsWrapReverse() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyBool(UPN_IS_WRAP_REVERSE); }
|
{ return getPropertyBool(UPN_IS_WRAP_REVERSE); }
|
||||||
virtual void SAL_CALL setIsWrapReverse(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setIsWrapReverse(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ setProperty(UPN_IS_WRAP_REVERSE, p1); }
|
{ setProperty(UPN_IS_WRAP_REVERSE, (bool) p1); }
|
||||||
virtual com::sun::star::lang::Locale SAL_CALL getDefaultLocale_CJK() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual com::sun::star::lang::Locale SAL_CALL getDefaultLocale_CJK() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
{ return getPropertyLocale(UPN_DEFAULT_LOCALE_CJK); }
|
{ return getPropertyLocale(UPN_DEFAULT_LOCALE_CJK); }
|
||||||
virtual void SAL_CALL setDefaultLocale_CJK(const com::sun::star::lang::Locale& p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
virtual void SAL_CALL setDefaultLocale_CJK(const com::sun::star::lang::Locale& p1) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||||
|
@@ -305,7 +305,7 @@ sal_Bool SAL_CALL
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (rxListener.is())
|
if (rxListener.is())
|
||||||
{
|
{
|
||||||
sal_Int32 nCount = aLngSvcEvtListeners.getLength();
|
sal_Int32 nCount = aLngSvcEvtListeners.getLength();
|
||||||
@@ -322,7 +322,7 @@ sal_Bool SAL_CALL
|
|||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (rxListener.is())
|
if (rxListener.is())
|
||||||
{
|
{
|
||||||
sal_Int32 nCount = aLngSvcEvtListeners.getLength();
|
sal_Int32 nCount = aLngSvcEvtListeners.getLength();
|
||||||
@@ -772,7 +772,7 @@ sal_Int16 PropertyHelper_Hyphenation::GetMinWordLength() const
|
|||||||
return pInst->GetMinWordLength();
|
return pInst->GetMinWordLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
|
bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
||||||
throw(::com::sun::star::uno::RuntimeException)
|
throw(::com::sun::star::uno::RuntimeException)
|
||||||
@@ -780,7 +780,7 @@ sal_Bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
|
|||||||
return pInst->addLinguServiceEventListener( rxListener );
|
return pInst->addLinguServiceEventListener( rxListener );
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
|
bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
|
||||||
throw(::com::sun::star::uno::RuntimeException)
|
throw(::com::sun::star::uno::RuntimeException)
|
||||||
|
@@ -55,9 +55,9 @@ uno::Sequence< OUString > static GetLangSvcList( const uno::Any &rVal );
|
|||||||
uno::Sequence< OUString > static GetLangSvc( const uno::Any &rVal );
|
uno::Sequence< OUString > static GetLangSvc( const uno::Any &rVal );
|
||||||
|
|
||||||
|
|
||||||
static sal_Bool lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const OUString &rText )
|
static bool lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const OUString &rText )
|
||||||
{
|
{
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
|
|
||||||
sal_Int32 nLen = rSeq.getLength();
|
sal_Int32 nLen = rSeq.getLength();
|
||||||
if (nLen == 0 || rText.isEmpty())
|
if (nLen == 0 || rText.isEmpty())
|
||||||
@@ -67,7 +67,7 @@ static sal_Bool lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const O
|
|||||||
for (sal_Int32 i = 0; i < nLen && !bRes; ++i)
|
for (sal_Int32 i = 0; i < nLen && !bRes; ++i)
|
||||||
{
|
{
|
||||||
if (rText == pSeq[i])
|
if (rText == pSeq[i])
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
}
|
}
|
||||||
return bRes;
|
return bRes;
|
||||||
}
|
}
|
||||||
@@ -157,11 +157,11 @@ struct SvcInfo
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool HasLanguage( sal_Int16 nLanguage ) const;
|
bool HasLanguage( sal_Int16 nLanguage ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
sal_Bool SvcInfo::HasLanguage( sal_Int16 nLanguage ) const
|
bool SvcInfo::HasLanguage( sal_Int16 nLanguage ) const
|
||||||
{
|
{
|
||||||
sal_Int32 nCnt = aSuppLanguages.getLength();
|
sal_Int32 nCnt = aSuppLanguages.getLength();
|
||||||
const sal_Int16 *pLang = aSuppLanguages.getConstArray();
|
const sal_Int16 *pLang = aSuppLanguages.getConstArray();
|
||||||
@@ -215,14 +215,14 @@ public:
|
|||||||
const linguistic2::DictionaryListEvent& rDicListEvent )
|
const linguistic2::DictionaryListEvent& rDicListEvent )
|
||||||
throw(uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
throw(uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
||||||
|
|
||||||
inline sal_Bool AddLngSvcMgrListener(
|
inline bool AddLngSvcMgrListener(
|
||||||
const uno::Reference< lang::XEventListener >& rxListener );
|
const uno::Reference< lang::XEventListener >& rxListener );
|
||||||
inline sal_Bool RemoveLngSvcMgrListener(
|
inline bool RemoveLngSvcMgrListener(
|
||||||
const uno::Reference< lang::XEventListener >& rxListener );
|
const uno::Reference< lang::XEventListener >& rxListener );
|
||||||
void DisposeAndClear( const lang::EventObject &rEvtObj );
|
void DisposeAndClear( const lang::EventObject &rEvtObj );
|
||||||
sal_Bool AddLngSvcEvtBroadcaster(
|
bool AddLngSvcEvtBroadcaster(
|
||||||
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster );
|
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster );
|
||||||
sal_Bool RemoveLngSvcEvtBroadcaster(
|
bool RemoveLngSvcEvtBroadcaster(
|
||||||
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster );
|
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster );
|
||||||
|
|
||||||
void AddLngSvcEvt( sal_Int16 nLngSvcEvt );
|
void AddLngSvcEvt( sal_Int16 nLngSvcEvt );
|
||||||
@@ -378,19 +378,19 @@ void LngSvcMgrListenerHelper::LaunchEvent( sal_Int16 nLngSvcEvtFlags )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline sal_Bool LngSvcMgrListenerHelper::AddLngSvcMgrListener(
|
inline bool LngSvcMgrListenerHelper::AddLngSvcMgrListener(
|
||||||
const uno::Reference< lang::XEventListener >& rxListener )
|
const uno::Reference< lang::XEventListener >& rxListener )
|
||||||
{
|
{
|
||||||
aLngSvcMgrListeners.addInterface( rxListener );
|
aLngSvcMgrListeners.addInterface( rxListener );
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline sal_Bool LngSvcMgrListenerHelper::RemoveLngSvcMgrListener(
|
inline bool LngSvcMgrListenerHelper::RemoveLngSvcMgrListener(
|
||||||
const uno::Reference< lang::XEventListener >& rxListener )
|
const uno::Reference< lang::XEventListener >& rxListener )
|
||||||
{
|
{
|
||||||
aLngSvcMgrListeners.removeInterface( rxListener );
|
aLngSvcMgrListeners.removeInterface( rxListener );
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -418,10 +418,10 @@ void LngSvcMgrListenerHelper::DisposeAndClear( const lang::EventObject &rEvtObj
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster(
|
bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster(
|
||||||
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
|
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
|
||||||
{
|
{
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (rxBroadcaster.is())
|
if (rxBroadcaster.is())
|
||||||
{
|
{
|
||||||
aLngSvcEvtBroadcasters.addInterface( rxBroadcaster );
|
aLngSvcEvtBroadcasters.addInterface( rxBroadcaster );
|
||||||
@@ -432,10 +432,10 @@ sal_Bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster(
|
bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster(
|
||||||
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
|
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
|
||||||
{
|
{
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (rxBroadcaster.is())
|
if (rxBroadcaster.is())
|
||||||
{
|
{
|
||||||
aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster );
|
aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster );
|
||||||
@@ -452,7 +452,7 @@ LngSvcMgr::LngSvcMgr()
|
|||||||
: utl::ConfigItem("Office.Linguistic")
|
: utl::ConfigItem("Office.Linguistic")
|
||||||
, aEvtListeners(GetLinguMutex())
|
, aEvtListeners(GetLinguMutex())
|
||||||
{
|
{
|
||||||
bDisposing = sal_False;
|
bDisposing = false;
|
||||||
|
|
||||||
pSpellDsp = 0;
|
pSpellDsp = 0;
|
||||||
pGrammarDsp = 0;
|
pGrammarDsp = 0;
|
||||||
@@ -589,7 +589,7 @@ namespace
|
|||||||
using uno::Any;
|
using uno::Any;
|
||||||
using uno::Sequence;
|
using uno::Sequence;
|
||||||
|
|
||||||
sal_Bool lcl_FindEntry( const OUString &rEntry, const Sequence< OUString > &rCfgSvcs )
|
bool lcl_FindEntry( const OUString &rEntry, const Sequence< OUString > &rCfgSvcs )
|
||||||
{
|
{
|
||||||
sal_Int32 nRes = -1;
|
sal_Int32 nRes = -1;
|
||||||
sal_Int32 nEntries = rCfgSvcs.getLength();
|
sal_Int32 nEntries = rCfgSvcs.getLength();
|
||||||
@@ -612,7 +612,7 @@ namespace
|
|||||||
OUString aCfgLocaleStr( LanguageTag::convertToBcp47( rAvailLocale ) );
|
OUString aCfgLocaleStr( LanguageTag::convertToBcp47( rAvailLocale ) );
|
||||||
|
|
||||||
Sequence< OUString > aNodeNames( rCfg.GetNodeNames(rLastFoundList) );
|
Sequence< OUString > aNodeNames( rCfg.GetNodeNames(rLastFoundList) );
|
||||||
sal_Bool bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames);
|
bool bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames);
|
||||||
|
|
||||||
if (bFound)
|
if (bFound)
|
||||||
{
|
{
|
||||||
@@ -812,7 +812,7 @@ void LngSvcMgr::UpdateAll()
|
|||||||
|
|
||||||
{
|
{
|
||||||
// add new or replace existing entries.
|
// add new or replace existing entries.
|
||||||
sal_Bool bRes = aCfg.ReplaceSetProperties( aSubNodeName, aNewValues );
|
bool bRes = aCfg.ReplaceSetProperties( aSubNodeName, aNewValues );
|
||||||
if (!bRes)
|
if (!bRes)
|
||||||
{
|
{
|
||||||
#if OSL_DEBUG_LEVEL > 1
|
#if OSL_DEBUG_LEVEL > 1
|
||||||
@@ -879,7 +879,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
|
|||||||
if (!aKeyText.isEmpty())
|
if (!aKeyText.isEmpty())
|
||||||
nLang = LanguageTag::convertToLanguageTypeWithFallback( aKeyText );
|
nLang = LanguageTag::convertToLanguageTypeWithFallback( aKeyText );
|
||||||
|
|
||||||
GetSpellCheckerDsp_Impl( sal_False ); // don't set service list, it will be done below
|
GetSpellCheckerDsp_Impl( false ); // don't set service list, it will be done below
|
||||||
pSpellDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
pSpellDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -906,7 +906,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
|
|||||||
|
|
||||||
if (SvtLinguConfig().HasGrammarChecker())
|
if (SvtLinguConfig().HasGrammarChecker())
|
||||||
{
|
{
|
||||||
GetGrammarCheckerDsp_Impl( sal_False ); // don't set service list, it will be done below
|
GetGrammarCheckerDsp_Impl( false ); // don't set service list, it will be done below
|
||||||
pGrammarDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
pGrammarDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -932,7 +932,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
|
|||||||
if (!aKeyText.isEmpty())
|
if (!aKeyText.isEmpty())
|
||||||
nLang = LanguageTag::convertToLanguageTypeWithFallback( aKeyText );
|
nLang = LanguageTag::convertToLanguageTypeWithFallback( aKeyText );
|
||||||
|
|
||||||
GetHyphenatorDsp_Impl( sal_False ); // don't set service list, it will be done below
|
GetHyphenatorDsp_Impl( false ); // don't set service list, it will be done below
|
||||||
pHyphDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
pHyphDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -957,7 +957,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
|
|||||||
if (!aKeyText.isEmpty())
|
if (!aKeyText.isEmpty())
|
||||||
nLang = LanguageTag::convertToLanguageTypeWithFallback( aKeyText );
|
nLang = LanguageTag::convertToLanguageTypeWithFallback( aKeyText );
|
||||||
|
|
||||||
GetThesaurusDsp_Impl( sal_False ); // don't set service list, it will be done below
|
GetThesaurusDsp_Impl( false ); // don't set service list, it will be done below
|
||||||
pThesDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
pThesDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -987,7 +987,7 @@ void LngSvcMgr::GetListenerHelper_Impl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LngSvcMgr::GetSpellCheckerDsp_Impl( sal_Bool bSetSvcList )
|
void LngSvcMgr::GetSpellCheckerDsp_Impl( bool bSetSvcList )
|
||||||
{
|
{
|
||||||
if (!pSpellDsp)
|
if (!pSpellDsp)
|
||||||
{
|
{
|
||||||
@@ -999,7 +999,7 @@ void LngSvcMgr::GetSpellCheckerDsp_Impl( sal_Bool bSetSvcList )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LngSvcMgr::GetGrammarCheckerDsp_Impl( sal_Bool bSetSvcList )
|
void LngSvcMgr::GetGrammarCheckerDsp_Impl( bool bSetSvcList )
|
||||||
{
|
{
|
||||||
if (!pGrammarDsp && SvtLinguConfig().HasGrammarChecker())
|
if (!pGrammarDsp && SvtLinguConfig().HasGrammarChecker())
|
||||||
{
|
{
|
||||||
@@ -1027,7 +1027,7 @@ void LngSvcMgr::GetGrammarCheckerDsp_Impl( sal_Bool bSetSvcList )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LngSvcMgr::GetHyphenatorDsp_Impl( sal_Bool bSetSvcList )
|
void LngSvcMgr::GetHyphenatorDsp_Impl( bool bSetSvcList )
|
||||||
{
|
{
|
||||||
if (!pHyphDsp)
|
if (!pHyphDsp)
|
||||||
{
|
{
|
||||||
@@ -1039,7 +1039,7 @@ void LngSvcMgr::GetHyphenatorDsp_Impl( sal_Bool bSetSvcList )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LngSvcMgr::GetThesaurusDsp_Impl( sal_Bool bSetSvcList )
|
void LngSvcMgr::GetThesaurusDsp_Impl( bool bSetSvcList )
|
||||||
{
|
{
|
||||||
if (!pThesDsp)
|
if (!pThesDsp)
|
||||||
{
|
{
|
||||||
@@ -1525,7 +1525,7 @@ sal_Bool SAL_CALL
|
|||||||
{
|
{
|
||||||
osl::MutexGuard aGuard( GetLinguMutex() );
|
osl::MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (!bDisposing && xListener.is())
|
if (!bDisposing && xListener.is())
|
||||||
{
|
{
|
||||||
if (!pListenerHelper)
|
if (!pListenerHelper)
|
||||||
@@ -1543,7 +1543,7 @@ sal_Bool SAL_CALL
|
|||||||
{
|
{
|
||||||
osl::MutexGuard aGuard( GetLinguMutex() );
|
osl::MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (!bDisposing && xListener.is())
|
if (!bDisposing && xListener.is())
|
||||||
{
|
{
|
||||||
DBG_ASSERT( pListenerHelper, "listener removed without being added" );
|
DBG_ASSERT( pListenerHelper, "listener removed without being added" );
|
||||||
@@ -1647,22 +1647,22 @@ uno::Sequence< lang::Locale > SAL_CALL
|
|||||||
return aRes;
|
return aRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
static sal_Bool IsEqSvcList( const uno::Sequence< OUString > &rList1,
|
static bool IsEqSvcList( const uno::Sequence< OUString > &rList1,
|
||||||
const uno::Sequence< OUString > &rList2 )
|
const uno::Sequence< OUString > &rList2 )
|
||||||
{
|
{
|
||||||
// returns sal_True iff both sequences are equal
|
// returns sal_True iff both sequences are equal
|
||||||
|
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
sal_Int32 nLen = rList1.getLength();
|
sal_Int32 nLen = rList1.getLength();
|
||||||
if (rList2.getLength() == nLen)
|
if (rList2.getLength() == nLen)
|
||||||
{
|
{
|
||||||
const OUString *pStr1 = rList1.getConstArray();
|
const OUString *pStr1 = rList1.getConstArray();
|
||||||
const OUString *pStr2 = rList2.getConstArray();
|
const OUString *pStr2 = rList2.getConstArray();
|
||||||
bRes = sal_True;
|
bRes = true;
|
||||||
for (sal_Int32 i = 0; i < nLen && bRes; ++i)
|
for (sal_Int32 i = 0; i < nLen && bRes; ++i)
|
||||||
{
|
{
|
||||||
if (*pStr1++ != *pStr2++)
|
if (*pStr1++ != *pStr2++)
|
||||||
bRes = sal_False;
|
bRes = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bRes;
|
return bRes;
|
||||||
@@ -1690,7 +1690,7 @@ void SAL_CALL
|
|||||||
{
|
{
|
||||||
if (!xSpellDsp.is())
|
if (!xSpellDsp.is())
|
||||||
GetSpellCheckerDsp_Impl();
|
GetSpellCheckerDsp_Impl();
|
||||||
sal_Bool bChanged = !IsEqSvcList( rServiceImplNames,
|
bool bChanged = !IsEqSvcList( rServiceImplNames,
|
||||||
pSpellDsp->GetServiceList( rLocale ) );
|
pSpellDsp->GetServiceList( rLocale ) );
|
||||||
if (bChanged)
|
if (bChanged)
|
||||||
{
|
{
|
||||||
@@ -1707,7 +1707,7 @@ void SAL_CALL
|
|||||||
{
|
{
|
||||||
if (!xGrammarDsp.is())
|
if (!xGrammarDsp.is())
|
||||||
GetGrammarCheckerDsp_Impl();
|
GetGrammarCheckerDsp_Impl();
|
||||||
sal_Bool bChanged = !IsEqSvcList( rServiceImplNames,
|
bool bChanged = !IsEqSvcList( rServiceImplNames,
|
||||||
pGrammarDsp->GetServiceList( rLocale ) );
|
pGrammarDsp->GetServiceList( rLocale ) );
|
||||||
if (bChanged)
|
if (bChanged)
|
||||||
{
|
{
|
||||||
@@ -1723,7 +1723,7 @@ void SAL_CALL
|
|||||||
{
|
{
|
||||||
if (!xHyphDsp.is())
|
if (!xHyphDsp.is())
|
||||||
GetHyphenatorDsp_Impl();
|
GetHyphenatorDsp_Impl();
|
||||||
sal_Bool bChanged = !IsEqSvcList( rServiceImplNames,
|
bool bChanged = !IsEqSvcList( rServiceImplNames,
|
||||||
pHyphDsp->GetServiceList( rLocale ) );
|
pHyphDsp->GetServiceList( rLocale ) );
|
||||||
if (bChanged)
|
if (bChanged)
|
||||||
{
|
{
|
||||||
@@ -1739,7 +1739,7 @@ void SAL_CALL
|
|||||||
{
|
{
|
||||||
if (!xThesDsp.is())
|
if (!xThesDsp.is())
|
||||||
GetThesaurusDsp_Impl();
|
GetThesaurusDsp_Impl();
|
||||||
sal_Bool bChanged = !IsEqSvcList( rServiceImplNames,
|
bool bChanged = !IsEqSvcList( rServiceImplNames,
|
||||||
pThesDsp->GetServiceList( rLocale ) );
|
pThesDsp->GetServiceList( rLocale ) );
|
||||||
if (bChanged)
|
if (bChanged)
|
||||||
{
|
{
|
||||||
@@ -1751,7 +1751,7 @@ void SAL_CALL
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool LngSvcMgr::SaveCfgSvcs( const OUString &rServiceName )
|
bool LngSvcMgr::SaveCfgSvcs( const OUString &rServiceName )
|
||||||
{
|
{
|
||||||
SAL_INFO( "linguistic", "linguistic: LngSvcMgr::SaveCfgSvcs" );
|
SAL_INFO( "linguistic", "linguistic: LngSvcMgr::SaveCfgSvcs" );
|
||||||
|
|
||||||
@@ -2004,7 +2004,7 @@ void SAL_CALL
|
|||||||
|
|
||||||
if (!bDisposing)
|
if (!bDisposing)
|
||||||
{
|
{
|
||||||
bDisposing = sal_True;
|
bDisposing = true;
|
||||||
|
|
||||||
// require listeners to release this object
|
// require listeners to release this object
|
||||||
lang::EventObject aEvtObj( static_cast<XLinguServiceManager*>(this) );
|
lang::EventObject aEvtObj( static_cast<XLinguServiceManager*>(this) );
|
||||||
@@ -2044,10 +2044,10 @@ void SAL_CALL
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool LngSvcMgr::AddLngSvcEvtBroadcaster(
|
bool LngSvcMgr::AddLngSvcEvtBroadcaster(
|
||||||
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
|
const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster )
|
||||||
{
|
{
|
||||||
sal_Bool bRes = sal_False;
|
bool bRes = false;
|
||||||
if (rxBroadcaster.is())
|
if (rxBroadcaster.is())
|
||||||
{
|
{
|
||||||
if (!pListenerHelper)
|
if (!pListenerHelper)
|
||||||
|
@@ -106,7 +106,7 @@ class LngSvcMgr :
|
|||||||
SvcInfoArray * pAvailHyphSvcs;
|
SvcInfoArray * pAvailHyphSvcs;
|
||||||
SvcInfoArray * pAvailThesSvcs;
|
SvcInfoArray * pAvailThesSvcs;
|
||||||
|
|
||||||
sal_Bool bDisposing;
|
bool bDisposing;
|
||||||
|
|
||||||
// disallow copy-constructor and assignment-operator for now
|
// disallow copy-constructor and assignment-operator for now
|
||||||
LngSvcMgr(const LngSvcMgr &);
|
LngSvcMgr(const LngSvcMgr &);
|
||||||
@@ -118,17 +118,17 @@ class LngSvcMgr :
|
|||||||
void GetAvailableThesSvcs_Impl();
|
void GetAvailableThesSvcs_Impl();
|
||||||
void GetListenerHelper_Impl();
|
void GetListenerHelper_Impl();
|
||||||
|
|
||||||
void GetSpellCheckerDsp_Impl( sal_Bool bSetSvcList = sal_True );
|
void GetSpellCheckerDsp_Impl( bool bSetSvcList = true );
|
||||||
void GetGrammarCheckerDsp_Impl( sal_Bool bSetSvcList = sal_True );
|
void GetGrammarCheckerDsp_Impl( bool bSetSvcList = true );
|
||||||
void GetHyphenatorDsp_Impl( sal_Bool bSetSvcList = sal_True );
|
void GetHyphenatorDsp_Impl( bool bSetSvcList = true );
|
||||||
void GetThesaurusDsp_Impl( sal_Bool bSetSvcList = sal_True );
|
void GetThesaurusDsp_Impl( bool bSetSvcList = true );
|
||||||
|
|
||||||
void SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp );
|
void SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp );
|
||||||
void SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp );
|
void SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp );
|
||||||
void SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp );
|
void SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp );
|
||||||
void SetCfgServiceLists( ThesaurusDispatcher &rThesDsp );
|
void SetCfgServiceLists( ThesaurusDispatcher &rThesDsp );
|
||||||
|
|
||||||
sal_Bool SaveCfgSvcs( const OUString &rServiceName );
|
bool SaveCfgSvcs( const OUString &rServiceName );
|
||||||
|
|
||||||
static void clearSvcInfoArray(SvcInfoArray *&rpInfo);
|
static void clearSvcInfoArray(SvcInfoArray *&rpInfo);
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ public:
|
|||||||
static inline OUString getImplementationName_Static();
|
static inline OUString getImplementationName_Static();
|
||||||
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
|
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
|
||||||
|
|
||||||
sal_Bool AddLngSvcEvtBroadcaster(
|
bool AddLngSvcEvtBroadcaster(
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster );
|
::com::sun::star::linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster );
|
||||||
};
|
};
|
||||||
|
@@ -59,7 +59,7 @@ class ProposalList: private boost::noncopyable
|
|||||||
{
|
{
|
||||||
std::vector< OUString > aVec;
|
std::vector< OUString > aVec;
|
||||||
|
|
||||||
sal_Bool HasEntry( const OUString &rText ) const;
|
bool HasEntry( const OUString &rText ) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProposalList() {}
|
ProposalList() {}
|
||||||
@@ -73,14 +73,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
sal_Bool ProposalList::HasEntry( const OUString &rText ) const
|
bool ProposalList::HasEntry( const OUString &rText ) const
|
||||||
{
|
{
|
||||||
sal_Bool bFound = sal_False;
|
bool bFound = false;
|
||||||
size_t nCnt = aVec.size();
|
size_t nCnt = aVec.size();
|
||||||
for (size_t i = 0; !bFound && i < nCnt; ++i)
|
for (size_t i = 0; !bFound && i < nCnt; ++i)
|
||||||
{
|
{
|
||||||
if (aVec[i] == rText)
|
if (aVec[i] == rText)
|
||||||
bFound = sal_True;
|
bFound = true;
|
||||||
}
|
}
|
||||||
return bFound;
|
return bFound;
|
||||||
}
|
}
|
||||||
@@ -151,11 +151,11 @@ Sequence< OUString > ProposalList::GetSequence() const
|
|||||||
return aRes;
|
return aRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SvcListHasLanguage(
|
bool SvcListHasLanguage(
|
||||||
const LangSvcEntries_Spell &rEntry,
|
const LangSvcEntries_Spell &rEntry,
|
||||||
LanguageType nLanguage )
|
LanguageType nLanguage )
|
||||||
{
|
{
|
||||||
sal_Bool bHasLanguage = sal_False;
|
bool bHasLanguage = false;
|
||||||
Locale aTmpLocale;
|
Locale aTmpLocale;
|
||||||
|
|
||||||
const Reference< XSpellChecker > *pRef = rEntry.aSvcRefs .getConstArray();
|
const Reference< XSpellChecker > *pRef = rEntry.aSvcRefs .getConstArray();
|
||||||
@@ -228,7 +228,7 @@ sal_Bool SAL_CALL
|
|||||||
throw(IllegalArgumentException, RuntimeException, std::exception)
|
throw(IllegalArgumentException, RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
return isValid_Impl( rWord, LinguLocaleToLanguage( rLocale ), rProperties, sal_True );
|
return isValid_Impl( rWord, LinguLocaleToLanguage( rLocale ), rProperties, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ Reference< XSpellAlternatives > SAL_CALL
|
|||||||
throw(IllegalArgumentException, RuntimeException, std::exception)
|
throw(IllegalArgumentException, RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
return spell_Impl( rWord, LinguLocaleToLanguage( rLocale ), rProperties, sal_True );
|
return spell_Impl( rWord, LinguLocaleToLanguage( rLocale ), rProperties, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -276,16 +276,16 @@ static Reference< XDictionaryEntry > lcl_GetRulingDictionaryEntry(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
bool SpellCheckerDispatcher::isValid_Impl(
|
||||||
const OUString& rWord,
|
const OUString& rWord,
|
||||||
LanguageType nLanguage,
|
LanguageType nLanguage,
|
||||||
const PropertyValues& rProperties,
|
const PropertyValues& rProperties,
|
||||||
sal_Bool bCheckDics)
|
bool bCheckDics)
|
||||||
throw( RuntimeException, IllegalArgumentException )
|
throw( RuntimeException, IllegalArgumentException )
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
|
|
||||||
sal_Bool bRes = sal_True;
|
bool bRes = true;
|
||||||
|
|
||||||
if (LinguIsUnspecified( nLanguage) || rWord.isEmpty())
|
if (LinguIsUnspecified( nLanguage) || rWord.isEmpty())
|
||||||
return bRes;
|
return bRes;
|
||||||
@@ -316,17 +316,17 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
|||||||
"lng : index out of range");
|
"lng : index out of range");
|
||||||
|
|
||||||
sal_Int32 i = 0;
|
sal_Int32 i = 0;
|
||||||
sal_Bool bTmpRes = sal_True;
|
bool bTmpRes = true;
|
||||||
sal_Bool bTmpResValid = sal_False;
|
bool bTmpResValid = false;
|
||||||
|
|
||||||
// try already instantiated services first
|
// try already instantiated services first
|
||||||
{
|
{
|
||||||
const Reference< XSpellChecker > *pRef =
|
const Reference< XSpellChecker > *pRef =
|
||||||
pEntry->aSvcRefs.getConstArray();
|
pEntry->aSvcRefs.getConstArray();
|
||||||
while (i <= pEntry->nLastTriedSvcIndex
|
while (i <= pEntry->nLastTriedSvcIndex
|
||||||
&& (!bTmpResValid || sal_False == bTmpRes))
|
&& (!bTmpResValid || !bTmpRes))
|
||||||
{
|
{
|
||||||
bTmpResValid = sal_True;
|
bTmpResValid = true;
|
||||||
if (pRef[i].is() && pRef[i]->hasLocale( aLocale ))
|
if (pRef[i].is() && pRef[i]->hasLocale( aLocale ))
|
||||||
{
|
{
|
||||||
bTmpRes = GetCache().CheckWord( aChkWord, nLanguage );
|
bTmpRes = GetCache().CheckWord( aChkWord, nLanguage );
|
||||||
@@ -342,7 +342,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bTmpResValid = sal_False;
|
bTmpResValid = false;
|
||||||
|
|
||||||
if (bTmpResValid)
|
if (bTmpResValid)
|
||||||
bRes = bTmpRes;
|
bRes = bTmpRes;
|
||||||
@@ -352,7 +352,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if still no result instantiate new services and try those
|
// if still no result instantiate new services and try those
|
||||||
if ((!bTmpResValid || sal_False == bTmpRes)
|
if ((!bTmpResValid || !bTmpRes)
|
||||||
&& pEntry->nLastTriedSvcIndex < nLen - 1)
|
&& pEntry->nLastTriedSvcIndex < nLen - 1)
|
||||||
{
|
{
|
||||||
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
|
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
|
||||||
@@ -365,7 +365,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
|||||||
Sequence< Any > aArgs(2);
|
Sequence< Any > aArgs(2);
|
||||||
aArgs.getArray()[0] <<= GetPropSet();
|
aArgs.getArray()[0] <<= GetPropSet();
|
||||||
|
|
||||||
while (i < nLen && (!bTmpResValid || sal_False == bTmpRes))
|
while (i < nLen && (!bTmpResValid || !bTmpRes))
|
||||||
{
|
{
|
||||||
// create specific service via it's implementation name
|
// create specific service via it's implementation name
|
||||||
Reference< XSpellChecker > xSpell;
|
Reference< XSpellChecker > xSpell;
|
||||||
@@ -387,7 +387,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
|||||||
if (xBroadcaster.is())
|
if (xBroadcaster.is())
|
||||||
rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
|
rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
|
||||||
|
|
||||||
bTmpResValid = sal_True;
|
bTmpResValid = true;
|
||||||
if (xSpell.is() && xSpell->hasLocale( aLocale ))
|
if (xSpell.is() && xSpell->hasLocale( aLocale ))
|
||||||
{
|
{
|
||||||
bTmpRes = GetCache().CheckWord( aChkWord, nLanguage );
|
bTmpRes = GetCache().CheckWord( aChkWord, nLanguage );
|
||||||
@@ -402,7 +402,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bTmpResValid = sal_False;
|
bTmpResValid = false;
|
||||||
if (bTmpResValid)
|
if (bTmpResValid)
|
||||||
bRes = bTmpRes;
|
bRes = bTmpRes;
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
|
|||||||
const OUString& rWord,
|
const OUString& rWord,
|
||||||
LanguageType nLanguage,
|
LanguageType nLanguage,
|
||||||
const PropertyValues& rProperties,
|
const PropertyValues& rProperties,
|
||||||
sal_Bool bCheckDics )
|
bool bCheckDics )
|
||||||
throw(IllegalArgumentException, RuntimeException)
|
throw(IllegalArgumentException, RuntimeException)
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( GetLinguMutex() );
|
MutexGuard aGuard( GetLinguMutex() );
|
||||||
@@ -484,7 +484,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
|
|||||||
|
|
||||||
sal_Int32 i = 0;
|
sal_Int32 i = 0;
|
||||||
Reference< XSpellAlternatives > xTmpRes;
|
Reference< XSpellAlternatives > xTmpRes;
|
||||||
sal_Bool bTmpResValid = sal_False;
|
bool bTmpResValid = false;
|
||||||
|
|
||||||
// try already instantiated services first
|
// try already instantiated services first
|
||||||
{
|
{
|
||||||
@@ -493,10 +493,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
|
|||||||
while (i <= pEntry->nLastTriedSvcIndex
|
while (i <= pEntry->nLastTriedSvcIndex
|
||||||
&& (!bTmpResValid || xTmpRes.is()) )
|
&& (!bTmpResValid || xTmpRes.is()) )
|
||||||
{
|
{
|
||||||
bTmpResValid = sal_True;
|
bTmpResValid = true;
|
||||||
if (pRef[i].is() && pRef[i]->hasLocale( aLocale ))
|
if (pRef[i].is() && pRef[i]->hasLocale( aLocale ))
|
||||||
{
|
{
|
||||||
sal_Bool bOK = GetCache().CheckWord( aChkWord, nLanguage );
|
bool bOK = GetCache().CheckWord( aChkWord, nLanguage );
|
||||||
if (bOK)
|
if (bOK)
|
||||||
xTmpRes = NULL;
|
xTmpRes = NULL;
|
||||||
else
|
else
|
||||||
@@ -511,7 +511,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bTmpResValid = sal_False;
|
bTmpResValid = false;
|
||||||
|
|
||||||
// return first found result if the word is not known by any checker.
|
// return first found result if the word is not known by any checker.
|
||||||
// But if that result has no suggestions use the first one that does
|
// But if that result has no suggestions use the first one that does
|
||||||
@@ -573,10 +573,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
|
|||||||
if (xBroadcaster.is())
|
if (xBroadcaster.is())
|
||||||
rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
|
rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
|
||||||
|
|
||||||
bTmpResValid = sal_True;
|
bTmpResValid = true;
|
||||||
if (xSpell.is() && xSpell->hasLocale( aLocale ))
|
if (xSpell.is() && xSpell->hasLocale( aLocale ))
|
||||||
{
|
{
|
||||||
sal_Bool bOK = GetCache().CheckWord( aChkWord, nLanguage );
|
bool bOK = GetCache().CheckWord( aChkWord, nLanguage );
|
||||||
if (bOK)
|
if (bOK)
|
||||||
xTmpRes = NULL;
|
xTmpRes = NULL;
|
||||||
else
|
else
|
||||||
@@ -591,7 +591,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bTmpResValid = sal_False;
|
bTmpResValid = false;
|
||||||
|
|
||||||
// return first found result if the word is not known by any checker.
|
// return first found result if the word is not known by any checker.
|
||||||
// But if that result has no suggestions use the first one that does
|
// But if that result has no suggestions use the first one that does
|
||||||
|
@@ -82,16 +82,16 @@ class SpellCheckerDispatcher :
|
|||||||
|
|
||||||
void ClearSvcList();
|
void ClearSvcList();
|
||||||
|
|
||||||
sal_Bool isValid_Impl(const OUString& aWord, LanguageType nLanguage,
|
bool isValid_Impl(const OUString& aWord, LanguageType nLanguage,
|
||||||
const ::com::sun::star::beans::PropertyValues& aProperties,
|
const ::com::sun::star::beans::PropertyValues& aProperties,
|
||||||
sal_Bool bCheckDics)
|
bool bCheckDics)
|
||||||
throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
|
throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
|
||||||
|
|
||||||
::com::sun::star::uno::Reference<
|
::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::linguistic2::XSpellAlternatives >
|
::com::sun::star::linguistic2::XSpellAlternatives >
|
||||||
spell_Impl(const OUString& aWord, LanguageType nLanguage,
|
spell_Impl(const OUString& aWord, LanguageType nLanguage,
|
||||||
const ::com::sun::star::beans::PropertyValues& aProperties,
|
const ::com::sun::star::beans::PropertyValues& aProperties,
|
||||||
sal_Bool bCheckDics)
|
bool bCheckDics)
|
||||||
throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
|
throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -111,7 +111,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq,
|
|||||||
sal_Int16 nLanguage )
|
sal_Int16 nLanguage )
|
||||||
{
|
{
|
||||||
static const OUString aEmpty;
|
static const OUString aEmpty;
|
||||||
sal_Bool bSthRemoved = sal_False;
|
bool bSthRemoved = false;
|
||||||
sal_Int32 nLen = rSeq.getLength();
|
sal_Int32 nLen = rSeq.getLength();
|
||||||
OUString *pEntries = rSeq.getArray();
|
OUString *pEntries = rSeq.getArray();
|
||||||
for (sal_Int32 i = 0; i < nLen; ++i)
|
for (sal_Int32 i = 0; i < nLen; ++i)
|
||||||
@@ -121,7 +121,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq,
|
|||||||
if (xNegEntry.is())
|
if (xNegEntry.is())
|
||||||
{
|
{
|
||||||
pEntries[i] = aEmpty;
|
pEntries[i] = aEmpty;
|
||||||
bSthRemoved = sal_True;
|
bSthRemoved = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bSthRemoved)
|
if (bSthRemoved)
|
||||||
|
@@ -40,11 +40,11 @@ using namespace linguistic;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static sal_Bool SvcListHasLanguage(
|
static bool SvcListHasLanguage(
|
||||||
const Sequence< Reference< XThesaurus > > &rRefs,
|
const Sequence< Reference< XThesaurus > > &rRefs,
|
||||||
const Locale &rLocale )
|
const Locale &rLocale )
|
||||||
{
|
{
|
||||||
sal_Bool bHasLanguage = sal_False;
|
bool bHasLanguage = false;
|
||||||
|
|
||||||
const Reference< XThesaurus > *pRef = rRefs.getConstArray();
|
const Reference< XThesaurus > *pRef = rRefs.getConstArray();
|
||||||
sal_Int32 nLen = rRefs.getLength();
|
sal_Int32 nLen = rRefs.getLength();
|
||||||
|
Reference in New Issue
Block a user