summaryrefslogtreecommitdiff
path: root/svx/source/items
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/items')
-rw-r--r--svx/source/items/svxfont.cxx42
-rw-r--r--svx/source/items/textitem.cxx2
2 files changed, 39 insertions, 5 deletions
diff --git a/svx/source/items/svxfont.cxx b/svx/source/items/svxfont.cxx
index 98c911c8a8..ed3225d58c 100644
--- a/svx/source/items/svxfont.cxx
+++ b/svx/source/items/svxfont.cxx
@@ -176,17 +176,49 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const
bBlank = TRUE;
else
{
- if( bBlank )
- {
- String aTemp( aTxt.GetChar( i ) );
+ String aTemp( aTxt.GetChar( i ) );
+ if( bBlank )
+ {
aCharClass.toUpper( aTemp );
- aTxt.Replace( i, 1, aTemp );
+ bBlank = FALSE;
+
+ }
+ else
+ {
+ aCharClass.toLower( aTemp );
}
- bBlank = FALSE;
+ aTxt.Replace( i, 1, aTemp );
+
}
}
break;
}
+ case SVX_CASEMAP_SENTENCE:
+ {
+ // SENTENCE CASE
+ BOOL bPoint = TRUE;
+
+ for( USHORT i = 0; i < aTxt.Len(); ++i )
+ {
+ sal_Unicode c = aTxt.GetChar(i);
+ if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c )
+ bPoint = TRUE;
+ else if( sal_Unicode(' ') == c || sal_Unicode('\t') == c )
+ ;
+ else
+ {
+ if( bPoint )
+ {
+ String aTemp( c );
+ aCharClass.toUpper( aTemp );
+ aTxt.Replace( i, 1, aTemp );
+ }
+ bPoint = FALSE;
+ }
+ }
+ break;
+ }
+
default:
{
DBG_ASSERT(!this, "SvxFont::CaseMapTxt: unknown casemap");
diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx
index 32e8b9f617..cabc6ffa21 100644
--- a/svx/source/items/textitem.cxx
+++ b/svx/source/items/textitem.cxx
@@ -2378,6 +2378,7 @@ sal_Bool SvxCaseMapItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const
case SVX_CASEMAP_VERSALIEN : nRet = style::CaseMap::UPPERCASE; break;
case SVX_CASEMAP_GEMEINE : nRet = style::CaseMap::LOWERCASE; break;
case SVX_CASEMAP_TITEL : nRet = style::CaseMap::TITLE ; break;
+ case SVX_CASEMAP_SENTENCE : nRet = style::CaseMap::SENTENCE ; break;
case SVX_CASEMAP_KAPITAELCHEN: nRet = style::CaseMap::SMALLCAPS; break;
}
rVal <<= (sal_Int16)(nRet);
@@ -2398,6 +2399,7 @@ sal_Bool SvxCaseMapItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ )
case style::CaseMap::UPPERCASE: nVal = SVX_CASEMAP_VERSALIEN ; break;
case style::CaseMap::LOWERCASE: nVal = SVX_CASEMAP_GEMEINE ; break;
case style::CaseMap::TITLE : nVal = SVX_CASEMAP_TITEL ; break;
+ case style::CaseMap::SENTENCE : nVal = SVX_CASEMAP_SENTENCE ; break;
case style::CaseMap::SMALLCAPS: nVal = SVX_CASEMAP_KAPITAELCHEN; break;
}
SetValue(nVal);