Kaydet (Commit) 66f3b170 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Fix char border merge

Reset font when previous seek remove border from
the font during border merge.

Change-Id: I7456a5494e510395ebebddb09ce2a9d8355156f7
üst 995c2cd3
......@@ -277,7 +277,7 @@ sal_Bool SwAttrIter::Seek( const xub_StrLen nNewPos )
if( pHints )
{
if( !nNewPos || nNewPos < nPos )
if( !nNewPos || nNewPos < nPos || m_bPrevSeekRemBorder )
{
if( pRedln )
pRedln->Clear( NULL );
......@@ -385,7 +385,7 @@ bool SwAttrIter::MergeCharBorder( const bool bStart )
const sal_Int32 nTmpStart = nStartIndex;
// Check whether next neightbour has same border and height
if( aTmpFont.GetRightBorder() && pHints && nTmpStart < pHints->GetStartCount() )
if( aTmpFont.GetRightBorder() && pHints && nEndIndex < pHints->GetEndCount() )
{
ImplSeekAndChgAttrIter(GetNextAttr(), pLastOut);
if( aTmpFont.GetHeight(pShell, *pLastOut) == pFnt->GetHeight(pShell, *pLastOut) &&
......@@ -396,7 +396,7 @@ bool SwAttrIter::MergeCharBorder( const bool bStart )
}
// Check whether previous neightbour has same border and height
if( aTmpFont.GetLeftBorder() && nTmpStart > 1)
if( aTmpFont.GetLeftBorder() && nTmpStart > 0)
{
ImplSeekAndChgAttrIter(nActPos-1, pLastOut);
if( aTmpFont.GetHeight(pShell, *pLastOut) == pFnt->GetHeight(pShell, *pLastOut) &&
......@@ -420,7 +420,7 @@ bool SwAttrIter::MergeCharBorder( const bool bStart )
if( bRemoveLeft )
pFnt->SetLeftBorder(0);
return bRemoveLeft || bRemoveRight;
return (m_bPrevSeekRemBorder = bRemoveLeft || bRemoveRight);
}
class SwMinMaxArgs
......
......@@ -57,18 +57,21 @@ private:
SwRedlineItr *pRedln;
xub_StrLen nStartIndex, nEndIndex, nPos;
sal_uInt8 nPropFont;
void SeekFwd( const xub_StrLen nPos );
inline void SetFnt( SwFont* pNew ) { pFnt = pNew; }
const void* aMagicNo[ SW_SCRIPTS ];
MSHORT aFntIdx[ SW_SCRIPTS ];
const SwTxtNode* m_pTxtNode;
/// previous seek remove left/right border of the current font during merge character border
bool m_bPrevSeekRemBorder;
void SeekFwd( const xub_StrLen nPos );
inline void SetFnt( SwFont* pNew ) { pFnt = pNew; }
protected:
void Chg( SwTxtAttr *pHt );
void Rst( SwTxtAttr *pHt );
void CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm = 0 );
inline SwAttrIter(SwTxtNode* pTxtNode)
: pShell(0), pFnt(0), pHints(0), pAttrSet(0), pScriptInfo(0), pLastOut(0), nChgCnt(0), pRedln(0), nPropFont(0), m_pTxtNode(pTxtNode) {
: pShell(0), pFnt(0), pHints(0), pAttrSet(0), pScriptInfo(0), pLastOut(0), nChgCnt(0), pRedln(0), nPropFont(0), m_pTxtNode(pTxtNode), m_bPrevSeekRemBorder(false) {
aMagicNo[SW_LATIN] = aMagicNo[SW_CJK] = aMagicNo[SW_CTL] = NULL;
}
......@@ -78,7 +81,7 @@ protected:
public:
// Constructor, destructor
inline SwAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf )
: pShell(0), pFnt(0), pHints(0), pScriptInfo(0), pLastOut(0), nChgCnt(0), pRedln(0),nPropFont(0), m_pTxtNode(&rTxtNode)
: pShell(0), pFnt(0), pHints(0), pScriptInfo(0), pLastOut(0), nChgCnt(0), pRedln(0),nPropFont(0), m_pTxtNode(&rTxtNode),m_bPrevSeekRemBorder(false)
{ CtorInitAttrIter( rTxtNode, rScrInf ); }
virtual ~SwAttrIter();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment