diff options
-rw-r--r-- | sw/inc/ndtxt.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/inc/flyfrm.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 47 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 8 |
6 files changed, 85 insertions, 1 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 66d4244869dc..46d4128a3fe5 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -196,6 +196,9 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable SW_DLLPRIVATE void impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet); public: + //Bug 120881:Modify here for Directly Page Numbering + bool HasPageNumberField(); + //Bug 120881(End) bool IsWordCountDirty() const; bool IsWrongDirty() const; bool IsGrammarCheckDirty() const; @@ -382,6 +385,10 @@ public: */ SwTxtAttr *GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich, enum GetTxtAttrMode const eMode = DEFAULT) const; + //Bug 120881:Modify here for Directly Page Numbering + SwTxtFld *GetTxtFld( xub_StrLen const rIdx ) + { return (SwTxtFld *)GetTxtAttrAt( rIdx, RES_TXTATR_FIELD ); } + //Bug 120881(End) /** get the innermost text attributes covering position nIndex. @param nWhich only attributes with this id are returned. diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 70c7c347a9da..f778636f2f32 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -150,6 +150,9 @@ protected: virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: +//Bug 120881:Modify here for Directly Page Numbering + sal_Bool IsPageNumberingFrm(); +//Bug 120881(End) // OD 2004-03-23 #i26791# TYPEINFO(); diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 5c5bd56d701c..a255abf1bd08 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -240,6 +240,10 @@ public: // Wird vom CollectAutoCmplWords gerufen void CollectAutoCmplWrds( SwCntntNode* , sal_uInt16 ); + //Bug 120881:Modify here for Directly Page Numbering + sal_Bool HasPageNumberField(); + //Bug 120881(End) + // Returns the screen position of rPos. The values are relative to the upper // left position of the page frame. // Additional information can be obtained by passing an SwCrsrMoveState object. diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 1ac3cfc6a6f1..994adb83356d 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1532,8 +1532,17 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs ) nNewSize = nAutoWidth; } } + /*else + nNewSize -= nLR;*/ else - nNewSize -= nLR; + {//Bug 120881:For enlarging fixed size Pagenumber frame,kangjian + if(nNewSize <= 500 && IsPageNumberingFrm()) + nNewSize = nNewSize - nLR + 150; + + else + nNewSize -= nLR; + //Bug 120881(End) + } if( nNewSize < MINFLY ) nNewSize = MINFLY; @@ -2967,3 +2976,39 @@ SwFlyFrmFmt * SwFlyFrm::GetFmt() return static_cast< SwFlyFrmFmt * >( GetDep() ); } +//Bug 120881:Modify here for Directly Page Numbering +sal_Bool SwFlyFrm::IsPageNumberingFrm() +{ + if (!GetAnchorFrm())//Invalidate frame... + return false; + if (bInCnt || bLayout)//Incorrect anchor type... + return false; + if (!(GetAnchorFrm()->IsTxtFrm() && GetAnchorFrm()->GetUpper() + && (GetAnchorFrm()->GetUpper()->FindFooterOrHeader())))//Not in header or footer frame + return false; + + if (pNextLink || pPrevLink)//Linked... + return false; + + SwFrmFmt* pFmt = NULL; + if (pFmt = GetFmt()) + { + if (pLower && pLower->GetNext() && pFmt->GetCol().GetNumCols()>1)//Has more than 1 column... + return false; + } + + if (!pLower)//Do not has even 1 child frame? + return false; + + for (SwFrm* pIter = pLower;pIter!=NULL;pIter=pIter->GetNext()) + { + if (pIter->IsTxtFrm() && ((SwTxtFrm*)pIter)->HasPageNumberField()) + { + return true; + } + } + return false; +} + +//Bug 120881(End) + diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 5e0c6ddc4d4a..abd3d526cdd8 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -5077,4 +5077,21 @@ SwTxtNode::MakeUnoObject() SwXParagraph::CreateXParagraph(*GetDoc(), *this), uno::UNO_QUERY); return xMeta; } +//Bug 120881:Modify here for Directly Page Numbering +bool SwTxtNode::HasPageNumberField() +{ + xub_StrLen nEnd = Len(); + for(xub_StrLen nStart=0;nStart<nEnd;nStart++) + { + SwTxtFld* pFld = GetTxtFld(nStart); + const SwField* pSwField = NULL; + const SwFieldType* pType = NULL; + if (pFld && (pSwField=pFld->GetFld().GetFld()) && + (pType=pSwField->GetTyp()) && pType->Which()==RES_PAGENUMBERFLD) + return true; + } + return false; + +} +//Bug 120881(End) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 3e720afe8132..6b814e1e4036 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -2211,3 +2211,11 @@ bool SwTxtNode::IsAutoCompleteWordDirty() const // // Paragraph statistics end // + +//Bug 120881:Modify here for Directly Page Numbering +sal_Bool SwTxtFrm::HasPageNumberField() +{ + return GetRegisteredIn()?((SwTxtNode*)GetRegisteredIn())->HasPageNumberField():false; +} +//Bug 120881(End) + |