diff options
author | Christian Lippka <cl@openoffice.org> | 2001-08-24 12:05:27 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2001-08-24 12:05:27 +0000 |
commit | d80eadf8c4f889aa3adb6ec8cb5ab1b031825759 (patch) | |
tree | 9a7408735f1ba2e6c10710af653049ae8a47fe2f /xmloff/source/draw/ximpbody.cxx | |
parent | 67d5c6fd2094387381b8628c53c8fa360e2595e9 (diff) |
#89061# added optimization for first page only previews
Diffstat (limited to 'xmloff/source/draw/ximpbody.cxx')
-rw-r--r-- | xmloff/source/draw/ximpbody.cxx | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index ac0fcef1d563..7041904fa715 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpbody.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: cl $ $Date: 2001-06-22 11:23:57 $ + * last change: $Author: cl $ $Date: 2001-08-24 13:01:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -386,32 +386,37 @@ SvXMLImportContext *SdXMLBodyContext::CreateChildContext( { case XML_TOK_BODY_PAGE: { - uno::Reference< drawing::XDrawPage > xNewDrawPage; - uno::Reference< drawing::XDrawPages > xDrawPages(GetSdImport().GetLocalDrawPages(), uno::UNO_QUERY); - - if(GetSdImport().GetNewPageCount() + 1 > xDrawPages->getCount()) - { - // new page, create and insert - xNewDrawPage = xDrawPages->insertNewByIndex(xDrawPages->getCount()); - } - else + // only read the first page in preview mode + if( (GetSdImport().GetNewPageCount() == 0) || !GetSdImport().IsPreview() ) { - // existing page, use it - uno::Any aAny(xDrawPages->getByIndex(GetSdImport().GetNewPageCount())); - aAny >>= xNewDrawPage; - } + // import this page + uno::Reference< drawing::XDrawPage > xNewDrawPage; + uno::Reference< drawing::XDrawPages > xDrawPages(GetSdImport().GetLocalDrawPages(), uno::UNO_QUERY); + + if(GetSdImport().GetNewPageCount() + 1 > xDrawPages->getCount()) + { + // new page, create and insert + xNewDrawPage = xDrawPages->insertNewByIndex(xDrawPages->getCount()); + } + else + { + // existing page, use it + uno::Any aAny(xDrawPages->getByIndex(GetSdImport().GetNewPageCount())); + aAny >>= xNewDrawPage; + } - // increment global import page counter - GetSdImport().IncrementNewPageCount(); + // increment global import page counter + GetSdImport().IncrementNewPageCount(); - if(xNewDrawPage.is()) - { - uno::Reference< drawing::XShapes > xNewShapes(xNewDrawPage, uno::UNO_QUERY); - if(xNewShapes.is()) + if(xNewDrawPage.is()) { - // draw:page inside office:body context - pContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList, - xNewShapes); + uno::Reference< drawing::XShapes > xNewShapes(xNewDrawPage, uno::UNO_QUERY); + if(xNewShapes.is()) + { + // draw:page inside office:body context + pContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList, + xNewShapes); + } } } break; |