summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/doc.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2010-09-24 14:47:51 +0200
committerKurt Zenker <kz@openoffice.org>2010-09-24 14:47:51 +0200
commit3e90c83c2439b4640131394b4f3999b643ce0c87 (patch)
treee2be6d850bd198f8262eacc5d3e424f2e9bbdb40 /sw/source/core/doc/doc.cxx
parentf5f6d4982b66dfec6d8364c622235bb60f7cb340 (diff)
parent4abe1904132f0eb34228c41454ef0abcb167f65c (diff)
CWS-TOOLING: integrate CWS sw33bf09ooo/OOO330_m9
Diffstat (limited to 'sw/source/core/doc/doc.cxx')
-rw-r--r--sw/source/core/doc/doc.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index a414c8fb9b..a470440968 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1714,16 +1714,22 @@ sal_uInt16 SwDoc::GetPageCount() const
const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
{
Size aSize;
- if( GetRootFrm() && nPageNum )
+ if ( GetRootFrm() && nPageNum )
{
const SwPageFrm* pPage = static_cast<const SwPageFrm*>
(GetRootFrm()->Lower());
- while( --nPageNum && pPage->GetNext() )
+ while ( --nPageNum && pPage->GetNext() )
+ {
pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+ }
- if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
+ // switch to next page for an empty page, if empty pages are not skipped
+ // in order to get a sensible page size for an empty page - e.g. for printing.
+ if ( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
+ {
pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+ }
aSize = pPage->Frm().SSize();
}