diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2009-12-14 10:26:21 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2009-12-14 10:26:21 +0100 |
commit | a98984185068a0a3ba26dd11e06965857649ce2e (patch) | |
tree | fa78e5cb833a8d128971841eebb3c23f7fdb9eca | |
parent | 82cc6b7302bcfb10496a6a87ba2432c467542c19 (diff) | |
parent | 49a1ef1150933fb8fc8db5fb069e6ae927037025 (diff) |
CWS-TOOLING: integrate CWS os139_DEV300
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/vprint.cxx | 59 |
2 files changed, 47 insertions, 14 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index b7b3afad72..e791d5c4ad 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1418,7 +1418,7 @@ void SwDoc::Paste( const SwDoc& rSource ) SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); if( FLY_PAGE == aAnchor.GetAnchorId() ) { - aAnchor.SetPageNum( aAnchor.GetPageNum() + /*nStartPageNumber - */1 ); + aAnchor.SetPageNum( aAnchor.GetPageNum() /*+ nStartPageNumber - */); } else continue; diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 069c4313f0..28348a682c 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -776,16 +776,32 @@ SwDoc * ViewShell::CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef &rDocShellR pActCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetPrev()); } - // Die Y-Position der ersten Selektion - const Point aSelPoint = pFESh->IsTableMode() ? - pFESh->GetTableCrsr()->GetSttPos() : - pFirstCrsr->GetSttPos(); + Point aSelPoint; + if( pFESh->IsTableMode() ) + { + SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); + + const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); + const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; + if( pCntntFrm ) + { + SwRect aCharRect; + SwCrsrMoveState aTmpState( MV_NONE ); + pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState ); + aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); + } + } + else + { + aSelPoint = pFirstCrsr->GetSttPos(); + } const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint ); + ASSERT( pPage, "no page found!" ); - // und ihren Seitendescribtor - const SwPageDesc* pPageDesc = pPrtDoc->FindPageDescByName( - pPage->GetPageDesc()->GetName() ); + // get page descriptor - fall back to the first one if pPage could not be found + const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName( + pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 ); if( !pFESh->IsTableMode() && pActCrsr->HasMark() ) { // Am letzten Absatz die Absatzattribute richten: @@ -868,15 +884,32 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) // Die Y-Position der ersten Selektion // Die Y-Position der ersten Selektion - const Point aSelPoint = pFESh->IsTableMode() ? - pFESh->GetTableCrsr()->GetSttPos() : - pFirstCrsr->GetSttPos(); + Point aSelPoint; + if( pFESh->IsTableMode() ) + { + SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); + + const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); + const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; + if( pCntntFrm ) + { + SwRect aCharRect; + SwCrsrMoveState aTmpState( MV_NONE ); + pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState ); + aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); + } + } + else + { + aSelPoint = pFirstCrsr->GetSttPos(); + } const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint ); + ASSERT( pPage, "no page found!" ); - // und ihren Seitendescribtor - const SwPageDesc* pPageDesc = pPrtDoc->FindPageDescByName( - pPage->GetPageDesc()->GetName() ); + // get page descriptor - fall back to the first one if pPage could not be found + const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName( + pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 ); if( !pFESh->IsTableMode() && pActCrsr->HasMark() ) { // Am letzten Absatz die Absatzattribute richten: |