CWS-TOOLING: integrate CWS fwk125

2009-11-19 08:11:20 +0100 jsk  r277554 : fwk125: #i105760# - removed warnlog, re-enabled autotest e_help.bas
2009-11-16 16:21:49 +0100 tl  r277521 : #i106571# fixed locale list for dictionaries to get rid of duplicate entries
2009-11-12 08:47:31 +0100 hde  r277469 : rework of hyphenation
2009-11-11 15:25:16 +0100 hde  r277462 : rework of hyphenation
2009-11-11 15:24:09 +0100 hde  r277461 : rework of hyphenation
2009-11-11 13:52:02 +0100 hde  r277453 : new include for hyphenation tools
2009-11-10 12:28:51 +0100 tl  r277427 : #i102304# fix for hyphenation dialog
2009-11-10 12:00:10 +0100 mav  r277425 : #i10000# A workaround for pch and windows headers conflict
2009-11-10 11:58:32 +0100 mav  r277424 : #i10000# A workaround for pch and windows headers conflict
2009-11-09 15:47:59 +0100 kso  r277414 : #i16732# fixed url matching.
2009-11-09 11:51:40 +0100 mav  r277406 : #i10000# use precompiled headers
2009-11-08 23:53:03 +0100 mav  r277399 : #i10000# fix warning
2009-11-08 23:50:23 +0100 mav  r277398 : #i10000# adapt for unix
2009-11-08 23:49:52 +0100 mav  r277397 : #i10000# adapt for unix
2009-11-08 21:26:06 +0100 mav  r277396 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320@277373 (milestone: OOO320:m4)
2009-11-06 16:30:27 +0100 ab  r277394 : #i106100# Hold references to packages to speed up further calls to getDeployedPackages()
2009-11-06 15:58:48 +0100 mav  r277392 : #i102464# check the Windows ACL
2009-11-06 15:58:23 +0100 mav  r277391 : #i102464# check the Windows ACL
2009-11-04 11:54:06 +0100 tl  r277342 : #i106497# incorrectly found 'supported languages' fixed
2009-11-04 10:40:51 +0100 tl  r277335 : #i106571# dictionary updates for Polish and Swedish.
2009-10-28 09:54:41 +0100 tl  r277236 : #i106100# context menu performance
2009-10-27 15:47:05 +0100 tl  r277213 : #i106100# context menu performance
2009-10-23 17:31:56 +0200 mav  r277170 : #i106075# use correct path to inprocserv.dll
2009-10-23 16:07:27 +0200 mav  r277168 : #i105760# seek the temporary file to beginning also for URL case
2009-10-23 11:03:58 +0200 mav  r277134 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320@276942 (milestone: OOO320:m2)
This commit is contained in:
Ivo Hinkelmann
2009-11-23 16:33:39 +00:00
parent d3af929cd3
commit 425eb5d131
2 changed files with 49 additions and 13 deletions

View File

@ -534,7 +534,7 @@ Reference < XHyphenatedWord > SAL_CALL
Reference< XPossibleHyphens > SAL_CALL
Hyphenator::createPossibleHyphens( const ::rtl::OUString& aWord,
const ::com::sun::star::lang::Locale& aLocale,
const ::com::sun::star::beans::PropertyValues& /*aProperties*/ )
const ::com::sun::star::beans::PropertyValues& aProperties )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException)
@ -544,6 +544,10 @@ Reference< XPossibleHyphens > SAL_CALL
char *lcword;
int k;
PropertyHelper_Hyphen & rHelper = GetPropHelper();
rHelper.SetTmpPropVals(aProperties);
sal_Int16 minTrail = rHelper.GetMinTrailing();
sal_Int16 minLead = rHelper.GetMinLeading();
HyphenDict *dict = NULL;
rtl_TextEncoding aEnc = 0;
@ -617,6 +621,9 @@ Reference< XPossibleHyphens > SAL_CALL
wordlen = encWord.getLength();
lcword = new char[wordlen+1];
hyphens = new char[wordlen+5];
char ** rep = NULL; // replacements of discretionary hyphenation
int * pos = NULL; // array of [hyphenation point] minus [deletion position]
int * cut = NULL; // length of deletions in original word
// copy converted word into simple char buffer
strcpy(lcword,encWord.getStr());
@ -627,10 +634,22 @@ Reference< XPossibleHyphens > SAL_CALL
n++;
// fprintf(stderr,"hyphenate... %s\n",lcword); fflush(stderr);
if (n > 0) {
if (hnj_hyphen_hyphenate(dict, lcword, n, hyphens))
if (hnj_hyphen_hyphenate3(dict, lcword, n, hyphens, NULL, &rep, &pos, &cut,
minLead, minTrail, Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))),
Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2)))))
{
delete[] hyphens;
delete[] lcword;
if (rep) {
for(int j = 0; j < n; j++) {
if (rep[j]) free(rep[j]);
}
free(rep);
}
if (pos) free(pos);
if (cut) free(cut);
return NULL;
}
}
@ -643,7 +662,7 @@ Reference< XPossibleHyphens > SAL_CALL
INT16 i;
for ( i = 0; i < encWord.getLength(); i++)
if (hyphens[i]&1)
if (hyphens[i]&1 && (!rep || !rep[i]))
nHyphCount++;
Sequence< INT16 > aHyphPos(nHyphCount);
@ -652,15 +671,14 @@ Reference< XPossibleHyphens > SAL_CALL
OUString hyphenatedWord;
nHyphCount = 0;
for (i = 0; i < encWord.getLength(); i++)
{
for (i = 0; i < nWord.getLength(); i++) {
hyphenatedWordBuffer.append(aWord[i]);
if (hyphens[i]&1)
{
pPos[nHyphCount] = i;
hyphenatedWordBuffer.append(sal_Unicode('='));
nHyphCount++;
}
// hyphenation position (not alternative)
if (hyphens[i]&1 && (!rep || !rep[i])) {
pPos[nHyphCount] = i;
hyphenatedWordBuffer.append(sal_Unicode('='));
nHyphCount++;
}
}
hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear();
@ -672,6 +690,16 @@ Reference< XPossibleHyphens > SAL_CALL
delete[] hyphens;
delete[] lcword;
if (rep) {
for(int j = 0; j < n; j++) {
if (rep[j]) free(rep[j]);
}
free(rep);
}
if (pos) free(pos);
if (cut) free(cut);
return xRes;
}

View File

@ -1370,6 +1370,16 @@ void SAL_CALL ZipPackage::commitChanges()
{
uno::Reference< io::XSeekable > xTempSeek( xTempInStream, uno::UNO_QUERY_THROW );
try
{
xTempSeek->seek( 0 );
}
catch( uno::Exception& r )
{
throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Temporary file should be seekable!" ) ),
static_cast < OWeakObject * > ( this ), makeAny ( r ) );
}
// switch to the new temporary stream only after the transfer
PostinitializationGuard aPostInitGuard( xTempInStream, *this );
@ -1381,8 +1391,6 @@ void SAL_CALL ZipPackage::commitChanges()
// preparation for copy step
try
{
xTempSeek->seek( 0 );
xOutputStream = m_xStream->getOutputStream();
uno::Reference < XTruncate > xTruncate ( xOutputStream, UNO_QUERY );
if ( !xTruncate.is() )