[ooo-build-commit] .: drawinglayer/inc drawinglayer/source editeng/inc editeng/source svx/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Sep 14 06:31:22 PDT 2010
drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx | 8 +
drawinglayer/source/primitive2d/textprimitive2d.cxx | 12 ++
drawinglayer/source/processor2d/vclprocessor2d.cxx | 41 ++++++++--
editeng/inc/editeng/editeng.hxx | 8 +
editeng/inc/editeng/outliner.hxx | 15 +++
editeng/source/editeng/editeng.cxx | 8 +
editeng/source/editeng/impedit3.cxx | 19 ++++
editeng/source/outliner/outleeng.cxx | 9 ++
editeng/source/outliner/outleeng.hxx | 8 +
editeng/source/outliner/outliner.cxx | 15 +++
svx/source/svdraw/svdotextdecomposition.cxx | 4
11 files changed, 134 insertions(+), 13 deletions(-)
New commits:
commit 6415b3fe7292bfd0c75bc52bacfd0cb51aeec19c
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Sep 14 15:28:33 2010 +0200
filled-tab-editeng.diff: Filled tab wasn't filled in shapes
n#564454
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index 3d630d8..d60e68c 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -129,6 +129,8 @@ namespace drawinglayer
/// #i96669# internal: add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
+ bool mbFilled; // Whether to fill a given width with the text
+ long mnWidthToFill; // the width to fill
protected:
/// local decomposition.
@@ -144,7 +146,9 @@ namespace drawinglayer
const ::std::vector< double >& rDXArray,
const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
- const basegfx::BColor& rFontColor);
+ const basegfx::BColor& rFontColor,
+ bool bFilled = false,
+ long nWidthToFill = 0);
/// helpers
/** get text outlines as polygons and their according ObjectTransformation. Handles all
@@ -161,6 +165,8 @@ namespace drawinglayer
const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
const basegfx::BColor& getFontColor() const { return maFontColor; }
+ bool isFilled() const { return mbFilled; }
+ long getWidthToFill() const { return mnWidthToFill; }
/// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 992d4dc..d97883d 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -237,7 +237,9 @@ namespace drawinglayer
const ::std::vector< double >& rDXArray,
const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
- const basegfx::BColor& rFontColor)
+ const basegfx::BColor& rFontColor,
+ bool bFilled,
+ long nWidthToFill)
: BufferedDecompositionPrimitive2D(),
maTextTransform(rNewTransform),
maText(rText),
@@ -247,7 +249,9 @@ namespace drawinglayer
maFontAttribute(rFontAttribute),
maLocale(rLocale),
maFontColor(rFontColor),
- maB2DRange()
+ maB2DRange(),
+ mbFilled(bFilled),
+ mnWidthToFill(nWidthToFill)
{
#ifdef DBG_UTIL
const xub_StrLen aStringLength(getText().Len());
@@ -276,7 +280,9 @@ namespace drawinglayer
&& getDXArray() == rCompare.getDXArray()
&& getFontAttribute() == rCompare.getFontAttribute()
&& LocalesAreEqual(getLocale(), rCompare.getLocale())
- && getFontColor() == rCompare.getFontColor());
+ && getFontColor() == rCompare.getFontColor()
+ && mbFilled == rCompare.mbFilled
+ && mnWidthToFill == rCompare.mnWidthToFill);
}
return false;
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 71bb587..678bbf4 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -250,22 +250,49 @@ namespace drawinglayer
mpOutputDevice->SetFont(aFont);
mpOutputDevice->SetTextColor(Color(aRGBFontColor));
+ String aText( rTextCandidate.getText() );
+ xub_StrLen nPos = rTextCandidate.getTextPosition();
+ xub_StrLen nLen = rTextCandidate.getTextLength();
+
+ sal_Int32* pDXArray = aTransformedDXArray.size() ? &(aTransformedDXArray[0]) : NULL ;
+
+ if ( rTextCandidate.isFilled() )
+ {
+ basegfx::B2DVector aOldFontScaling, aOldTranslate;
+ double fOldRotate, fOldShearX;
+ rTextCandidate.getTextTransform().decompose(aOldFontScaling, aOldTranslate, fOldRotate, fOldShearX);
+
+ long nWidthToFill = rTextCandidate.getWidthToFill( ) * aFontScaling.getX() / aOldFontScaling.getX();
+
+ long nWidth = mpOutputDevice->GetTextArray(
+ rTextCandidate.getText(), pDXArray, 0, 1 );
+ long nChars = 2;
+ if ( nWidth )
+ nChars = nWidthToFill / nWidth;
+
+ String aFilled;
+ aFilled.Fill( (USHORT)nChars, aText.GetChar( 0 ) );
+ aText = aFilled;
+ nPos = 0;
+ nLen = nChars;
+ }
+
if(aTransformedDXArray.size())
{
mpOutputDevice->DrawTextArray(
aStartPoint,
- rTextCandidate.getText(),
- &(aTransformedDXArray[0]),
- rTextCandidate.getTextPosition(),
- rTextCandidate.getTextLength());
+ aText,
+ pDXArray,
+ nPos,
+ nLen);
}
else
{
mpOutputDevice->DrawText(
aStartPoint,
- rTextCandidate.getText(),
- rTextCandidate.getTextPosition(),
- rTextCandidate.getTextLength());
+ aText,
+ nPos,
+ nLen);
}
if(rTextCandidate.getFontAttribute().getRTL())
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 3ba1e82..797cd85 100755
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -443,6 +443,14 @@ public:
const Color& rOverlineColor,
const Color& rTextLineColor);
+ virtual void DrawingTab(
+ const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+
virtual String GetUndoComment( USHORT nUndoId ) const;
virtual BOOL FormattingParagraph( USHORT nPara );
virtual BOOL SpellNextDocument();
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index 5e1e62a..44c2a71 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -422,6 +422,9 @@ public:
// #101498# BiDi level needs to be transported, too.
BYTE mnBiDiLevel;
+ bool mbFilled;
+ long mnWidthToFill;
+
// bitfield
unsigned mbEndOfLine : 1;
unsigned mbEndOfParagraph : 1;
@@ -445,6 +448,8 @@ public:
const Color& rOverlineColor,
const Color& rTextLineColor,
BYTE nBiDiLevel,
+ bool bFilled,
+ long nWidthToFill,
bool bEndOfLine,
bool bEndOfParagraph,
bool bEndOfBullet)
@@ -462,6 +467,8 @@ public:
maOverlineColor(rOverlineColor),
maTextLineColor(rTextLineColor),
mnBiDiLevel(nBiDiLevel),
+ mbFilled( bFilled ),
+ mnWidthToFill( nWidthToFill ),
mbEndOfLine(bEndOfLine),
mbEndOfParagraph(bEndOfParagraph),
mbEndOfBullet(bEndOfBullet)
@@ -895,6 +902,14 @@ public:
const Color& rOverlineColor,
const Color& rTextLineColor);
+ virtual void DrawingTab(
+ const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+
Size CalcTextSize();
Point GetDocPos( Paragraph* pPara );
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 2a6e5f3..1956cff 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2480,6 +2480,14 @@ void __EXPORT EditEngine::DrawingText( const Point&, const XubString&, USHORT, U
DBG_CHKTHIS( EditEngine, 0 );
}
+void __EXPORT EditEngine::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft,
+ bool bEndOfLine, bool bEndOfParagraph,
+ const Color& rOverlineColor, const Color& rTextLineColor)
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+}
+
void __EXPORT EditEngine::PaintingFirstLine( sal_uInt16, const Point&, long, const Point&, short, OutputDevice* )
{
DBG_CHKTHIS( EditEngine, 0 );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 01d36c2..15e4db7 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3517,7 +3517,26 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
String aText;
aText.Fill( (USHORT)nChars, pTextPortion->GetExtraValue() );
+ aTmpFont.QuickDrawText( pOutDev, aTmpPos, aText, 0, aText.Len(), NULL );
pOutDev->DrawStretchText( aTmpPos, pTextPortion->GetSize().Width(), aText );
+
+ if ( bStripOnly )
+ {
+ // create EOL and EOP bools
+ const bool bEndOfLine(y == pLine->GetEndPortion());
+ const bool bEndOfParagraph(bEndOfLine && nLine + 1 == nLines);
+
+ const Color aOverlineColor(pOutDev->GetOverlineColor());
+ const Color aTextLineColor(pOutDev->GetTextLineColor());
+
+ // StripPortions() data callback
+ GetEditEnginePtr()->DrawingTab( aTmpPos,
+ pTextPortion->GetSize().Width(),
+ pTextPortion->GetExtraValue(),
+ aTmpFont, n, nIndex, pTextPortion->GetRightToLeft(),
+ bEndOfLine, bEndOfParagraph,
+ aOverlineColor, aTextLineColor);
+ }
}
}
break;
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index f8d4b9a..820492f 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -204,6 +204,15 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rTex
pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, bEndOfBullet, pLocale, rOverlineColor, rTextLineColor);
}
+void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft,
+ bool bEndOfLine, bool bEndOfParagraph,
+ const Color& rOverlineColor, const Color& rTextLineColor)
+{
+ pOwner->DrawingTab(rStartPos, nWidth, rChar, rFont, nPara, nIndex, nRightToLeft,
+ bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor );
+}
+
void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, USHORT nPara, USHORT nPos )
{
EditEngine::FieldClicked( rField, nPara, nPos ); // Falls URL
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index 96cafc8..536af8b 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -68,6 +68,14 @@ public:
const Color& rOverlineColor,
const Color& rTextLineColor);
+ virtual void DrawingTab(
+ const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+
virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
virtual void ParaAttribsChanged( USHORT nPara );
virtual BOOL SpellNextDocument();
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index e0a89aa..e8aa629 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1790,7 +1790,20 @@ void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, USHO
{
// #101498#
DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, nPara, nIndex, pDXArray, pWrongSpellVector,
- pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, bEndOfLine, bEndOfParagraph, bEndOfBullet);
+ pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet);
+
+ aDrawPortionHdl.Call( &aInfo );
+ }
+}
+
+void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar, const SvxFont& rFont,
+ USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
+ const Color& rOverlineColor, const Color& rTextLineColor)
+{
+ if(aDrawPortionHdl.IsSet())
+ {
+ DrawPortionInfo aInfo( rStartPos, rChar, 0, rChar.Len(), rFont, nPara, nIndex, NULL, NULL,
+ NULL, NULL, rOverlineColor, rTextLineColor, nRightToLeft, true, nWidth, bEndOfLine, bEndOfParagraph, false);
aDrawPortionHdl.Call( &aInfo );
}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 760287a..1bb2001 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -370,7 +370,9 @@ namespace
aDXArray,
aFontAttribute,
rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(),
- aBFontColor);
+ aBFontColor,
+ rInfo.mbFilled,
+ rInfo.mnWidthToFill);
}
if(rInfo.mbEndOfBullet)
More information about the ooo-build-commit
mailing list