Kaydet (Commit) 7abb5e2b authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

CWS-TOOLING: integrate CWS sw33bf08

......@@ -51,6 +51,7 @@
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <i18npool/lang.h>
#include <vos/ref.hxx>
......@@ -1002,6 +1003,8 @@ public:
void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow );
EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets );
void SetAsianCompressionMode( USHORT n );
USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; }
......
......@@ -1243,27 +1243,25 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
else if ( bIsNextRun && !IsAutoCorrectChar( cChar ) )
{
// Remove the NBSP if it wasn't an autocorrection
if ( NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
if ( nInsPos != 0 && NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
cChar != ' ' && cChar != '\t' && cChar != CHAR_HARDBLANK )
{
// Look for the last HARD_SPACE
xub_StrLen nPos = nInsPos - 1;
bool bFound = false;
while ( nPos != STRING_NOTFOUND && !bFound )
bool bContinue = true;
while ( bContinue )
{
sal_Unicode cTmpChar = rTxt.GetChar( nPos );
const sal_Unicode cTmpChar = rTxt.GetChar( nPos );
if ( cTmpChar == CHAR_HARDBLANK )
bFound = true;
else if ( !NeedsHardspaceAutocorr( cTmpChar ) )
nPos = STRING_NOTFOUND;
{
rDoc.Delete( nPos, nPos + 1 );
nRet = AddNonBrkSpace;
bContinue = false;
}
else if ( !NeedsHardspaceAutocorr( cTmpChar ) || nPos == 0 )
bContinue = false;
nPos--;
}
if ( bFound && nPos != STRING_NOTFOUND )
{
rDoc.Delete( nPos + 1, nPos + 2 );
nRet = AddNonBrkSpace;
}
}
}
}
......
......@@ -45,6 +45,8 @@
#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/uri.hxx>
#include <rtl/bootstrap.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/makesequence.hxx>
......@@ -136,6 +138,24 @@ uno::Reference<rdf::XURI> createBaseURI(
throw uno::RuntimeException();
}
// #i108078# workaround non-hierarchical vnd.sun.star.expand URIs
// this really should be done somewhere else, not here.
::rtl::OUString pkgURI(i_rPkgURI);
if (pkgURI.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:")))
{
// expand it here (makeAbsolute requires hierarchical URI)
pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") );
if (pkgURI.getLength() != 0) {
pkgURI = ::rtl::Uri::decode(
pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8);
if (pkgURI.getLength() == 0) {
throw uno::RuntimeException();
}
::rtl::Bootstrap::expandMacros(pkgURI);
}
}
const uno::Reference<lang::XMultiComponentFactory> xServiceFactory(
i_xContext->getServiceManager(), uno::UNO_SET_THROW);
const uno::Reference<uri::XUriReferenceFactory> xUriFactory(
......@@ -146,11 +166,12 @@ uno::Reference<rdf::XURI> createBaseURI(
uno::Reference< uri::XUriReference > xBaseURI;
const uno::Reference< uri::XUriReference > xPkgURI(
xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW );
xUriFactory->parse(pkgURI), uno::UNO_SET_THROW );
xPkgURI->clearFragment();
// need to know whether the storage is a FileSystemStorage
// XServiceInfo would be better, but it is not implemented
// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) )
// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) )
if (true) {
xBaseURI.set( xPkgURI, uno::UNO_SET_THROW );
#if 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