summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-23 16:59:26 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-23 16:59:26 +0100
commitd4e88719d67c5cadb55c85cd372d412fd969c613 (patch)
tree7213e99d8df05f9676cacb75e43f8a0789b263ab /editeng
parentdab1b528ed2e2e0f7c494b3d955d8e0ba9798c0a (diff)
parentd46e1d383278641d664dce56965c11b05ac95b4a (diff)
Merge commit 'ooo/DEV300_m103'
Conflicts: basic/source/runtime/makefile.mk basic/source/runtime/step2.cxx desktop/prj/build.lst desktop/source/app/app.cxx desktop/source/deployment/registry/dp_backend.cxx drawinglayer/source/attribute/fontattribute.cxx editeng/inc/editeng/fontitem.hxx editeng/source/editeng/edtspell.cxx editeng/source/misc/svxacorr.cxx framework/inc/services/substitutepathvars.hxx framework/source/services/substitutepathvars.cxx sfx2/qa/cppunit/makefile.mk sfx2/source/doc/SfxDocumentMetaData.cxx sfx2/source/doc/objxtor.cxx svx/source/dialog/svxruler.cxx sysui/desktop/icons/so9_base_app.ico sysui/desktop/icons/so9_calc_app.ico sysui/desktop/icons/so9_draw_app.ico sysui/desktop/icons/so9_impress_app.ico sysui/desktop/icons/so9_main_app.ico sysui/desktop/icons/so9_math_app.ico sysui/desktop/icons/so9_writer_app.ico xmlhelp/source/cxxhelp/provider/databases.cxx xmlhelp/source/cxxhelp/provider/db.cxx xmlhelp/source/cxxhelp/provider/db.hxx
Diffstat (limited to 'editeng')
-rwxr-xr-xediteng/inc/editeng/fontitem.hxx23
-rwxr-xr-xediteng/inc/editeng/svxacorr.hxx1
-rwxr-xr-xediteng/source/editeng/editobj.cxx4
-rwxr-xr-xediteng/source/editeng/edtspell.cxx7
-rwxr-xr-xediteng/source/editeng/edtspell.hxx1
-rw-r--r--editeng/source/editeng/impedit4.cxx10
-rwxr-xr-xediteng/source/editeng/textconv.cxx10
-rw-r--r--editeng/source/items/numitem.cxx2
-rwxr-xr-x[-rw-r--r--]editeng/source/items/textitem.cxx20
-rwxr-xr-x[-rw-r--r--]editeng/source/misc/svxacorr.cxx43
-rwxr-xr-xediteng/source/uno/unofdesc.cxx10
11 files changed, 90 insertions, 41 deletions
diff --git a/editeng/inc/editeng/fontitem.hxx b/editeng/inc/editeng/fontitem.hxx
index b133626bf9..95b4b8e5ec 100755
--- a/editeng/inc/editeng/fontitem.hxx
+++ b/editeng/inc/editeng/fontitem.hxx
@@ -82,31 +82,24 @@ public:
String &rText, const IntlWrapper * = 0 ) const;
// Access methods:
- inline String &GetFamilyName() { return aFamilyName; }
+ void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; }
inline const String &GetFamilyName() const { return aFamilyName; }
- inline String &GetStyleName() { return aStyleName; }
+ void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; }
inline const String &GetStyleName() const { return aStyleName; }
- inline FontFamily &GetFamily() { return eFamily; }
+ void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
inline FontFamily GetFamily() const { return eFamily; }
- inline FontPitch &GetPitch() { return ePitch; }
+ void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
inline FontPitch GetPitch() const { return ePitch; }
- inline rtl_TextEncoding &GetCharSet() { return eTextEncoding; }
+ void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
+
inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
- inline SvxFontItem& operator=(const SvxFontItem& rFont)
- {
- aFamilyName = rFont.GetFamilyName();
- aStyleName = rFont.GetStyleName();
- eFamily = rFont.GetFamily();
- ePitch = rFont.GetPitch();
- eTextEncoding = rFont.GetCharSet();
- return *this;
- }
-
+ SvxFontItem& operator=(const SvxFontItem& rFont);
+
static void EnableStoreUnicodeNames( sal_Bool bEnable );
};
diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx
index 1bc75b0816..3f2ae90c56 100755
--- a/editeng/inc/editeng/svxacorr.hxx
+++ b/editeng/inc/editeng/svxacorr.hxx
@@ -82,6 +82,7 @@ public:
virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0;
virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt ) = 0;
virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt ) = 0;
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ) = 0;
virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& ) = 0;
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index f8a0cb0a5b..b6aa52a043 100755
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1424,7 +1424,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
if ( hConv )
{
SvxFontItem aNewFontItem( rFontItem );
- aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv );
+ aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) );
pC->GetAttribs().Remove( nAttr );
XEditAttribute* pNewAttr = CreateAttrib( aNewFontItem, pAttr->GetStart(), pAttr->GetEnd() );
@@ -1455,7 +1455,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
if ( hConv )
{
SvxFontItem aNewFontItem( rFontItem );
- aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv );
+ aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) );
pC->GetParaAttribs().Put( aNewFontItem );
for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ )
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 67cfaad9e4..7396bc7d93 100755
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -581,8 +581,13 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt )
sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt )
{
+ return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+
+sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
// Actually a Replace introduce => corresponds to UNDO
- sal_uInt16 nEnd = nPos+rTxt.Len();
+ sal_uInt16 nEnd = nPos+nSourceLength;
if ( nEnd > pCurNode->Len() )
nEnd = pCurNode->Len();
diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx
index bba15ef230..e62fd29103 100755
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -159,6 +159,7 @@ public:
virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd );
virtual sal_Bool Insert( sal_uInt16 nPos, const String& rTxt );
virtual sal_Bool Replace( sal_uInt16 nPos, const String& rTxt );
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& );
virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 48016aafe0..6246ae9684 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1614,11 +1614,11 @@ void ImpEditEngine::SetLanguageAndFont(
{
// set new font attribute
SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet( pFont->GetCharSet() );
aNewSet.Put( aFontItem );
}
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx
index 262f1330c9..b7d6a8c421 100755
--- a/editeng/source/editeng/textconv.cxx
+++ b/editeng/source/editeng/textconv.cxx
@@ -275,11 +275,11 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel,
{
// set new font attribute
SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId );
- aFontItem.GetFamilyName() = pFont->GetName();
- aFontItem.GetFamily() = pFont->GetFamily();
- aFontItem.GetStyleName() = pFont->GetStyleName();
- aFontItem.GetPitch() = pFont->GetPitch();
- aFontItem.GetCharSet() = pFont->GetCharSet();
+ aFontItem.SetFamilyName( pFont->GetName());
+ aFontItem.SetFamily( pFont->GetFamily());
+ aFontItem.SetStyleName( pFont->GetStyleName());
+ aFontItem.SetPitch( pFont->GetPitch());
+ aFontItem.SetCharSet(pFont->GetCharSet());
aNewSet.Put( aFontItem );
}
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 266776a0cc..f04b8eaa48 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -376,6 +376,8 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
{
+ if (& rFormat == this) { return *this; }
+
SetNumberingType(rFormat.GetNumberingType());
eNumAdjust = rFormat.eNumAdjust ;
nInclUpperLevels = rFormat.nInclUpperLevels ;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 43a6ab8808..463aa93782 100644..100755
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -256,6 +256,16 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName,
}
// -----------------------------------------------------------------------
+SvxFontItem& SvxFontItem::operator=(const SvxFontItem& rFont)
+{
+ aFamilyName = rFont.GetFamilyName();
+ aStyleName = rFont.GetStyleName();
+ eFamily = rFont.GetFamily();
+ ePitch = rFont.GetPitch();
+ eTextEncoding = rFont.GetCharSet();
+ return *this;
+}
+// -----------------------------------------------------------------------
bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
@@ -3712,11 +3722,11 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo
aOutTypeArr[ n ].nLanguage,
DEFAULTFONT_FLAGS_ONLYONE, 0 ) );
SvxFontItem* pItem = aItemArr[ n ];
- pItem->GetFamily() = aFont.GetFamily();
- pItem->GetFamilyName() = aFont.GetName();
- pItem->GetStyleName().Erase();
- pItem->GetPitch() = aFont.GetPitch();
- pItem->GetCharSet() = aFont.GetCharSet();
+ pItem->SetFamily( aFont.GetFamily() );
+ pItem->SetFamilyName( aFont.GetName() );
+ pItem->SetStyleName( String() );
+ pItem->SetPitch( aFont.GetPitch());
+ pItem->SetCharSet(aFont.GetCharSet());
}
}
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index a73452059b..3081606e6c 100644..100755
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/i18n/UnicodeType.hdl>
#include <unotools/collatorwrapper.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
#include <unotools/localedatawrapper.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -141,6 +142,41 @@ inline int IsUpperLetter( sal_Int32 nCharType )
0 == ( ::com::sun::star::i18n::KCharacterType::LOWER & nCharType);
}
+bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const String& rTxt,
+ xub_StrLen nStt, xub_StrLen nEnd )
+{
+ for( ; nStt < nEnd; ++nStt )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ sal_Int32 nCharType;
+ sal_Int32 nChType;
+ nCharType = rCC.getCharacterType( rTxt, nStt );
+ nChType = rCC.getType( rTxt, nStt );
+#endif
+ short nScript = rCC.getScript( rTxt, nStt );
+ switch( nScript )
+ {
+ case ::com::sun::star::i18n::UnicodeScript_kCJKRadicalsSupplement:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulJamo:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKSymbolPunctuation:
+ case ::com::sun::star::i18n::UnicodeScript_kHiragana:
+ case ::com::sun::star::i18n::UnicodeScript_kKatakana:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulCompatibilityJamo:
+ case ::com::sun::star::i18n::UnicodeScript_kEnclosedCJKLetterMonth:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibility:
+ case ::com::sun::star::i18n::UnicodeScript_k_CJKUnifiedIdeographsExtensionA:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKUnifiedIdeograph:
+ case ::com::sun::star::i18n::UnicodeScript_kHangulSyllable:
+ case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibilityIdeograph:
+ case ::com::sun::star::i18n::UnicodeScript_kHalfwidthFullwidthForm:
+ return true;
+ default: ; //do nothing
+ }
+
+ }
+ return false;
+}
+
sal_Bool lcl_IsSymbolChar( CharClass& rCC, const String& rTxt,
xub_StrLen nStt, xub_StrLen nEnd )
{
@@ -455,7 +491,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt,
sal_Unicode cSave = rTxt.GetChar( nSttPos );
String sChar( cSave );
rCC.toLower( sChar );
- if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ))
+ if( sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ))
{
if( SaveWordWrdSttLst & nFlags )
rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave );
@@ -886,7 +922,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
String sChar( *pWordStt );
rCC.toUpper( sChar );
return sChar != *pWordStt &&
- rDoc.Replace( xub_StrLen( pWordStt - pStart ), sChar );
+ rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar );
}
aText = *pPrevPara;
@@ -1061,7 +1097,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() );
String sChar( cSave );
rCC.toUpper( sChar );
- sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar );
+ sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar );
// Parahaps someone wants to have the word
if( bRet && SaveWordCplSttLst & nFlags )
@@ -1323,6 +1359,7 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
eLang = MsLangId::getSystemLanguage();
CharClass& rCC = GetCharClass( eLang );
+ // no symbol characters
if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nInsPos ))
break;
diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx
index 7ae3d79875..7c24f97893 100755
--- a/editeng/source/uno/unofdesc.cxx
+++ b/editeng/source/uno/unofdesc.cxx
@@ -90,11 +90,11 @@ void SvxUnoFontDescriptor::FillItemSet( const awt::FontDescriptor& rDesc, SfxIte
{
SvxFontItem aFontItem( EE_CHAR_FONTINFO );
- aFontItem.GetFamilyName()= rDesc.Name;
- aFontItem.GetStyleName() = rDesc.StyleName;
- aFontItem.GetFamily() = (FontFamily)rDesc.Family;
- aFontItem.GetCharSet() = rDesc.CharSet;
- aFontItem.GetPitch() = (FontPitch)rDesc.Pitch;
+ aFontItem.SetFamilyName( rDesc.Name);
+ aFontItem.SetStyleName( rDesc.StyleName);
+ aFontItem.SetFamily( (FontFamily)rDesc.Family);
+ aFontItem.SetCharSet( rDesc.CharSet );
+ aFontItem.SetPitch( (FontPitch)rDesc.Pitch);
rSet.Put(aFontItem);
}