summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-14 15:28:33 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-14 15:30:39 +0200
commit6415b3fe7292bfd0c75bc52bacfd0cb51aeec19c (patch)
tree31e13d631c5ced52f4cc511fad537c52921032a9
parent150b71f82c682889427a3df2accee6cc44d85ccb (diff)
filled-tab-editeng.diff: Filled tab wasn't filled in shapes
n#564454
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx8
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx12
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx41
-rwxr-xr-xediteng/inc/editeng/editeng.hxx8
-rw-r--r--editeng/inc/editeng/outliner.hxx15
-rw-r--r--editeng/source/editeng/editeng.cxx8
-rw-r--r--editeng/source/editeng/impedit3.cxx19
-rw-r--r--editeng/source/outliner/outleeng.cxx9
-rw-r--r--editeng/source/outliner/outleeng.hxx8
-rw-r--r--editeng/source/outliner/outliner.cxx15
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx4
11 files changed, 134 insertions, 13 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index 3d630d8551..d60e68cba1 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 992d4dc0a8..d97883d211 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 71bb587339..678bbf4ac6 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 3ba1e820aa..797cd8509e 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 5e1e62aded..44c2a716c6 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 2a6e5f32a5..1956cff531 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 01d36c223c..15e4db7956 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 f8d4b9a199..820492fd53 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 96cafc8aea..536af8b3d1 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 e0a89aae91..e8aa6292b3 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 760287af46..1bb20011e4 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)