diff options
author | Oliver-Rainer Wittmann <od@openoffice.org> | 2010-03-16 09:54:03 +0100 |
---|---|---|
committer | Oliver-Rainer Wittmann <od@openoffice.org> | 2010-03-16 09:54:03 +0100 |
commit | 2670e195169501bfc687d5a3f65544142c7a3b92 (patch) | |
tree | 6ce9f8408a49cf350c1841b5452aaf5fb3e73eed | |
parent | 2959a7982f9470f110808f8ce2bfa408477a348f (diff) |
sw321bf01: #b6921213# - No keep of footnote portion with previous portion, if text line only contains footnote portions
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/text/portxt.cxx | 8 |
4 files changed, 16 insertions, 3 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index f7c96d9dc745..7687a71309ac 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -276,6 +276,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew ) bURLNotify( rNew.URLNotify() ), bStopUnderFlow( rNew.StopUnderFlow() ), bFtnInside( rNew.IsFtnInside() ), + bOtherThanFtnInside( rNew.IsOtherThanFtnInside() ), bMulti( rNew.IsMulti() ), bFirstMulti( rNew.IsFirstMulti() ), bRuby( rNew.IsRuby() ), @@ -373,7 +374,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt, nIdx = nNewIdx; nLen = nNewLen; bNotEOL = sal_False; - bStopUnderFlow = bFtnInside = sal_False; + bStopUnderFlow = bFtnInside = bOtherThanFtnInside = sal_False; bMulti = bFirstMulti = bRuby = bHanging = bScriptSpace = bForbiddenChars = sal_False; @@ -400,6 +401,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt, bURLNotify( rNew.URLNotify() ), bStopUnderFlow( rNew.StopUnderFlow() ), bFtnInside( rNew.IsFtnInside() ), + bOtherThanFtnInside( rNew.IsOtherThanFtnInside() ), bMulti( rNew.IsMulti() ), bFirstMulti( rNew.IsFirstMulti() ), bRuby( rNew.IsRuby() ), diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 69a4ed1f3fe6..c0643653a1d6 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -208,6 +208,8 @@ protected: sal_Bool bURLNotify : 1; sal_Bool bStopUnderFlow : 1;// Underflow gestoppt z.B. von einer FlyPortion sal_Bool bFtnInside : 1; // the current line contains a footnote + sal_Bool bOtherThanFtnInside : 1; // the current line contains another portion than a footnote portion. + // needed for checking keep together of footnote portion with previous portion sal_Bool bMulti : 1; // inside a multiportion sal_Bool bFirstMulti : 1; // this flag is used for two purposes: // - the multiportion is the first lineportion @@ -251,6 +253,8 @@ public: inline void SetStopUnderFlow( const sal_Bool bNew ) { bStopUnderFlow = bNew; } inline sal_Bool IsFtnInside() const { return bFtnInside; } inline void SetFtnInside( const sal_Bool bNew ) { bFtnInside = bNew; } + inline sal_Bool IsOtherThanFtnInside() const { return bOtherThanFtnInside; } + inline void SetOtherThanFtnInside( const sal_Bool bNew ) { bOtherThanFtnInside = bNew; } inline sal_Bool IsMulti() const { return bMulti; } inline void SetMulti( const sal_Bool bNew ) { bMulti = bNew; } inline sal_Bool IsFirstMulti() const { return bFirstMulti; } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 84f877ed3328..c7527b372554 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -349,6 +349,8 @@ void SwTxtFormatter::InsertPortion( SwTxtFormatInfo &rInf, } pLast->Insert( pPor ); + rInf.SetOtherThanFtnInside( rInf.IsOtherThanFtnInside() || !pPor->IsFtnPortion() ); + // Maxima anpassen: if( pCurr->Height() < pPor->Height() ) pCurr->Height( pPor->Height() ); @@ -1533,6 +1535,7 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos ) while( bBuild ) { GetInfo().SetFtnInside( sal_False ); + GetInfo().SetOtherThanFtnInside( sal_False ); // These values must not be reset by FormatReset(); sal_Bool bOldNumDone = GetInfo().IsNumDone(); diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index b1d236cb0471..a849cbe42f40 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -394,12 +394,16 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) } // case C1 // - Footnote portions with fake line start (i.e., not at beginning of line) - // should keep together with the text portion. + // should keep together with the text portion. (Note: no keep together + // with only footnote portions. // - TabPortions not at beginning of line should keep together with the // text portion, if they are not followed by a blank // (work around different definition of tab stop character - breaking or // non breaking character - in compatibility mode) - else if ( ( IsFtnPortion() && rInf.IsFakeLineStart() ) || + else if ( ( IsFtnPortion() && rInf.IsFakeLineStart() && + // --> OD 2010-01-29 #b6921213# + rInf.IsOtherThanFtnInside() ) || + // <-- ( rInf.GetLast() && rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) && rInf.GetLast()->InTabGrp() && |