summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatteocam <matteo.campanelli@gmail.com>2014-05-28 16:20:14 -0400
committerFridrich Štrba <fridrich.strba@bluewin.ch>2014-06-30 22:54:38 +0200
commitbe34ea6f62a357eaaab01ce14e2882528015e1d1 (patch)
tree8e206c3cbb44889b1e8aa0c8fbd0a8c4abf18be8
parentfcbfcc75ed6157f4eb4124c7cfeda4346ddc6b45 (diff)
Cleaned up code from operations in vcl
Change-Id: Ica5194f0cf6e30ec099974ae8b794fb2bc5e654a (cherry picked from commit 4445f361aa2730b61fdd339dcdd7014b266e5c42)
-rw-r--r--editeng/source/editeng/impedit3.cxx17
-rw-r--r--include/editeng/eeitem.hxx18
-rw-r--r--include/vcl/font.hxx8
-rw-r--r--vcl/source/gdi/font.cxx11
-rw-r--r--vcl/source/outdev/outdevstate.cxx2
-rw-r--r--vcl/source/outdev/text.cxx12
6 files changed, 40 insertions, 28 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index b5053b2e16f8..86a8090875c2 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2556,6 +2556,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
rFont = pNode->GetCharAttribs().GetDefFont();
+ /*
+ * Set attributes for script types Asian and Complex
+ */
short nScriptType = GetI18NScriptType( EditPaM( pNode, nPos ) );
if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) )
{
@@ -2574,6 +2577,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
sal_uInt16 nRelWidth = ((const SvxCharScaleWidthItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_FONTWIDTH)).GetValue();
+ /*
+ * Set output device's line and overline colors
+ */
if ( pOut )
{
const SvxUnderlineItem& rTextLineColor = (const SvxUnderlineItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_UNDERLINE );
@@ -2594,6 +2600,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
const SvxLanguageItem* pCJKLanguageItem = NULL;
+ /*
+ * Scan through char attributes of pNode
+ */
if ( aStatus.UseCharAttribs() )
{
CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs();
@@ -3412,6 +3421,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
' ' == aText[nTextStart + nTextLen - 1] )
--nTextLen;
+ // FIXME(matteocam)
+ if (aTmpFont.GetItalic() != ITALIC_NONE) {
+ Color aColor = COL_BROWN;
+ aTmpFont.SetFillColor(aColor);
+ }
+
// output directly
aTmpFont.QuickDrawText( pOutDev, aRealOutPos, aText, nTextStart, nTextLen, pDXArray );
@@ -3684,6 +3699,8 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev
SvxFont aTmpFont;
ContentNode* pNode = GetEditDoc().GetObject( 0 );
SeekCursor( pNode, 1, aTmpFont );
+
+
Color aFontColor( aTmpFont.GetColor() );
if( (aFontColor == COL_AUTO) || IsForceAutoColor() )
aFontColor = GetAutoColor();
diff --git a/include/editeng/eeitem.hxx b/include/editeng/eeitem.hxx
index 8dcf5c553bd7..b42b326b0b1e 100644
--- a/include/editeng/eeitem.hxx
+++ b/include/editeng/eeitem.hxx
@@ -80,18 +80,18 @@
#define EE_CHAR_OVERLINE (EE_ITEMS_START+47)
#define EE_CHAR_CASEMAP (EE_ITEMS_START+48)
#define EE_CHAR_GRABBAG (EE_ITEMS_START+49)
-#define EE_CHAR_BKGCOLOR (EE_ITEMS_START+50)
+//#define EE_CHAR_BKGCOLOR (EE_ITEMS_START+50)
-#define EE_CHAR_END (EE_ITEMS_START+50)
+#define EE_CHAR_END (EE_ITEMS_START+49)
-#define EE_FEATURE_START (EE_ITEMS_START+51)
-#define EE_FEATURE_TAB (EE_ITEMS_START+51)
-#define EE_FEATURE_LINEBR (EE_ITEMS_START+52)
-#define EE_FEATURE_NOTCONV (EE_ITEMS_START+53)
-#define EE_FEATURE_FIELD (EE_ITEMS_START+54)
-#define EE_FEATURE_END (EE_ITEMS_START+54)
+#define EE_FEATURE_START (EE_ITEMS_START+50)
+#define EE_FEATURE_TAB (EE_ITEMS_START+50)
+#define EE_FEATURE_LINEBR (EE_ITEMS_START+51)
+#define EE_FEATURE_NOTCONV (EE_ITEMS_START+52)
+#define EE_FEATURE_FIELD (EE_ITEMS_START+53)
+#define EE_FEATURE_END (EE_ITEMS_START+53)
-#define EE_ITEMS_END (EE_ITEMS_START+54)
+#define EE_ITEMS_END (EE_ITEMS_START+53)
#define EDITITEMCOUNT ( EE_ITEMS_END - EE_ITEMS_START + 1 )
diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
index 1a728f34bba9..b4a36146cfdf 100644
--- a/include/vcl/font.hxx
+++ b/include/vcl/font.hxx
@@ -60,12 +60,10 @@ public:
void SetAlign( FontAlign );
FontAlign GetAlign() const;
- // XXX: now font has background iff it is (single-y) underlined
- // also forces non transparency
- bool HasBackgroundColor() const {
+ // FIXME(matteocam) // XXX: is this the right spot for changes?
+ void SetBackgroundColor(const Color &);
+ const Color& GetBackgroundColor() const;
- return GetUnderline() == UNDERLINE_SINGLE;
- }
void SetName( const OUString& rFamilyName );
const OUString& GetName() const;
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 489304e7cb9a..616fb61ca96f 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -301,6 +301,15 @@ void Font::SetFillColor( const Color& rColor )
mpImplFont->mbTransparent = true;
}
+void Font::SetBackgroundColor(const Color& rColor)
+{
+ // FIXME
+ //MakeUnique();
+ /*mpImplFont->maBkgColor = rColor;
+ if () */
+}
+
+
void Font::SetTransparent( bool bTransparent )
{
@@ -957,6 +966,8 @@ const Color& Font::GetColor() const { return mpImplFont->maColor; }
const Color& Font::GetFillColor() const { return mpImplFont->maFillColor; }
+const Color& Font::GetBackgroundColor() const { /*return mpImplFont->maBkgColor;*/ }
+
bool Font::IsTransparent() const { return mpImplFont->mbTransparent; }
FontAlign Font::GetAlign() const { return mpImplFont->meAlign; }
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index 15fa53ccb1f3..2dcaf11f76a0 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -520,8 +520,6 @@ void OutputDevice::SetFont( const Font& rNewFont )
aFont.SetColor( aTextColor );
- mbTextBackground = aFont.HasBackgroundColor();
-
bool bTransFill = aFont.IsTransparent();
if ( !bTransFill )
{
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 2d50f4ddb303..33ff382c29b4 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -481,18 +481,6 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
rSalLayout.DrawBase() += Point( mnTextOffX, mnTextOffY );
- /*
- if the text has some background get it
- and the set it as the new filling color
- */
- if (mbTextBackground) {
- // FIXME(matteocam)
- // set right background // (XXX: now getting fixed color)
- Color aColor = RGB_COLORDATA(0x66,0x66, 0xFF); // blue-ish
- // SetBackground does not work
- SetTextFillColor(aColor);
- }
-
if( IsTextFillColor() )
ImplDrawTextBackground( rSalLayout );