summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 6c67bded2b17..94c7ee2c192b 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 f5566246ef91..5e85d5dc3654 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 e49e54fb751c..ca53ae07e916 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 84f4802e7b44..563da3cb74be 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 d167d2a30f8f..1825c74e302c 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 1b61a405dc18..8e4b2a4645a6 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 08f50a0da884..524d69592298 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 de0a555f004c..8e1f1e689961 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 fadbd8779eea..70398c39620f 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 328a762fec54..9e9b5dcc0e70 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 3675c7becac4..d67b18c0805b 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)