summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2001-08-24 12:05:27 +0000
committerChristian Lippka <cl@openoffice.org>2001-08-24 12:05:27 +0000
commitd80eadf8c4f889aa3adb6ec8cb5ab1b031825759 (patch)
tree9a7408735f1ba2e6c10710af653049ae8a47fe2f /xmloff
parent67d5c6fd2094387381b8628c53c8fa360e2595e9 (diff)
#89061# added optimization for first page only previews
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx11
-rw-r--r--xmloff/source/draw/sdxmlimp_impl.hxx8
-rw-r--r--xmloff/source/draw/ximpbody.cxx53
3 files changed, 43 insertions, 29 deletions
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index b01cd66cc46d..eb1e22f9e6ed 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlimp.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: aw $ $Date: 2001-08-01 11:44:09 $
+ * 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
@@ -559,7 +559,9 @@ SdXMLImport::SdXMLImport( sal_Bool bIsDraw, sal_uInt16 nImportFlags )
mnNewMasterPageCount(0L),
mbLoadDoc(sal_True),
mbIsDraw(bIsDraw),
- msPageLayouts( RTL_CONSTASCII_USTRINGPARAM( "PageLayouts" ) )
+ mbPreview(sal_False),
+ msPageLayouts( RTL_CONSTASCII_USTRINGPARAM( "PageLayouts" ) ),
+ msPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) )
{
// add namespaces
GetNamespaceMap().Add(
@@ -629,6 +631,9 @@ void SAL_CALL SdXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen
if( xInfoSetInfo->hasPropertyByName( msPageLayouts ) )
xInfoSet->getPropertyValue( msPageLayouts ) >>= mxPageLayouts;
+
+ if( xInfoSetInfo->hasPropertyByName( msPreview ) )
+ xInfoSet->getPropertyValue( msPreview ) >>= mbPreview;
}
}
diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx
index a2f80069c848..c214090ecdab 100644
--- a/xmloff/source/draw/sdxmlimp_impl.hxx
+++ b/xmloff/source/draw/sdxmlimp_impl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlimp_impl.hxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: aw $ $Date: 2001-07-31 16:30:15 $
+ * 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
@@ -248,10 +248,12 @@ class SdXMLImport: public SvXMLImport
sal_Bool mbIsDraw;
sal_Bool mbLoadDoc;
+ sal_Bool mbPreview;
DrawPageIdMap maDrawPageIds;
::rtl::OUString msPageLayouts;
+ ::rtl::OUString msPreview;
protected:
// This method is called after the namespace map has been updated, but
@@ -335,6 +337,8 @@ public:
// #80365#
virtual void SetStatisticAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs);
+
+ sal_Bool IsPreview() const { return mbPreview; }
};
#endif // _SDXMLIMP_HXX
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;