Kaydet (Commit) 9f2341f0 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS tl07 (1.6.22); FILE MERGED

2005/03/15 11:20:54 tl 1.6.22.3: RESYNC: (1.7-1.8); FILE MERGED
2005/02/14 14:54:52 tl 1.6.22.2: RESYNC: (1.6-1.7); FILE MERGED
2005/01/13 14:39:04 iha 1.6.22.1: #39319# new button should contain update functionality
üst bc498db5
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: hangulhanjadlg.cxx,v $ * $RCSfile: hangulhanjadlg.cxx,v $
* *
* $Revision: 1.8 $ * $Revision: 1.9 $
* *
* last change: $Author: vg $ $Date: 2005-02-16 17:55:10 $ * last change: $Author: rt $ $Date: 2005-04-04 08:29:15 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1439,7 +1439,7 @@ namespace svx ...@@ -1439,7 +1439,7 @@ namespace svx
const String* SuggestionList::_Next( void ) const String* SuggestionList::_Next( void )
{ {
const String* pRet = NULL; const String* pRet = NULL;
while( m_nAct < m_nNumOfEntries && !pRet ) while( m_nAct < m_nSize && !pRet )
{ {
pRet = m_ppElements[ m_nAct ]; pRet = m_ppElements[ m_nAct ];
if( !pRet ) if( !pRet )
...@@ -1646,6 +1646,9 @@ namespace svx ...@@ -1646,6 +1646,9 @@ namespace svx
Reference< XConversionDictionary > xDict = m_rDictList[ m_nCurrentDict ]; Reference< XConversionDictionary > xDict = m_rDictList[ m_nCurrentDict ];
if( xDict.is() && m_pSuggestions ) if( xDict.is() && m_pSuggestions )
{ {
//delete old entry
bool bRemovedSomething = DeleteEntryFromDictionary( m_aOriginal, xDict );
OUString aLeft( m_aOriginal ); OUString aLeft( m_aOriginal );
const String* pRight = m_pSuggestions->First(); const String* pRight = m_pSuggestions->First();
bool bAddedSomething = false; bool bAddedSomething = false;
...@@ -1653,6 +1656,7 @@ namespace svx ...@@ -1653,6 +1656,7 @@ namespace svx
{ {
try try
{ {
//add new entry
xDict->addEntry( aLeft, *pRight ); xDict->addEntry( aLeft, *pRight );
bAddedSomething = true; bAddedSomething = true;
} }
...@@ -1666,7 +1670,7 @@ namespace svx ...@@ -1666,7 +1670,7 @@ namespace svx
pRight = m_pSuggestions->Next(); pRight = m_pSuggestions->Next();
} }
if(bAddedSomething) if(bAddedSomething||bRemovedSomething)
InitEditDictDialog( m_nCurrentDict ); InitEditDictDialog( m_nCurrentDict );
} }
else else
...@@ -1676,9 +1680,9 @@ namespace svx ...@@ -1676,9 +1680,9 @@ namespace svx
return 0; return 0;
} }
IMPL_LINK( HangulHanjaEditDictDialog, DeletePBPushHdl, void*, NOTINTERESTEDIN ) bool HangulHanjaEditDictDialog::DeleteEntryFromDictionary( const OUString& rEntry, const Reference< XConversionDictionary >& xDict )
{ {
Reference< XConversionDictionary > xDict = m_rDictList[ m_nCurrentDict ]; bool bRemovedSomething = false;
if( xDict.is() ) if( xDict.is() )
{ {
OUString aOrg( m_aOriginal ); OUString aOrg( m_aOriginal );
...@@ -1687,7 +1691,6 @@ namespace svx ...@@ -1687,7 +1691,6 @@ namespace svx
sal_uInt32 n = aEntries.getLength(); sal_uInt32 n = aEntries.getLength();
OUString* pEntry = aEntries.getArray(); OUString* pEntry = aEntries.getArray();
bool bRemovedSomething = false;
while( n ) while( n )
{ {
try try
...@@ -1702,13 +1705,17 @@ namespace svx ...@@ -1702,13 +1705,17 @@ namespace svx
++pEntry; ++pEntry;
--n; --n;
} }
}
return bRemovedSomething;
}
if( bRemovedSomething ) IMPL_LINK( HangulHanjaEditDictDialog, DeletePBPushHdl, void*, NOTINTERESTEDIN )
{ {
m_aOriginal.Erase(); if( DeleteEntryFromDictionary( m_aOriginal, m_rDictList[ m_nCurrentDict ] ) )
m_bModifiedOriginal = true; {
InitEditDictDialog( m_nCurrentDict ); m_aOriginal.Erase();
} m_bModifiedOriginal = true;
InitEditDictDialog( m_nCurrentDict );
} }
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment