diff options
author | Michael Brauer <mib@openoffice.org> | 2000-11-21 13:25:43 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2000-11-21 13:25:43 +0000 |
commit | 7a24baa4c22e39792f7dc6192d24dc6cd5ff3dd3 (patch) | |
tree | 4e95a5d711e2dbae1f84893f429cee9bdf7afc95 /xmloff | |
parent | eac16c5572481ed8fb2113c8e35e540f99e9a688 (diff) |
#80552#: progress bar and document statistics
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtftne.cxx | 19 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 17 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 73 |
3 files changed, 70 insertions, 39 deletions
diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index 374838a611f4..56eb83584064 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtftne.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2000-11-17 18:54:34 $ + * last change: $Author: mib $ $Date: 2000-11-21 14:25:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -152,7 +152,7 @@ using namespace ::com::sun::star::text; void XMLTextParagraphExport::exportTextFootnote( const Reference<XPropertySet> & rPropSet, const OUString& sText, - sal_Bool bAutoStyles) + sal_Bool bAutoStyles, sal_Bool bProgress ) { // get footnote and associated text Any aAny; @@ -172,7 +172,7 @@ void XMLTextParagraphExport::exportTextFootnote( // handle formatting within footnote exportTextFootnoteHelper(xFootnote, xText, sText, - bAutoStyles, bIsEndnote); + bAutoStyles, bIsEndnote, bProgress ); } else { @@ -186,12 +186,12 @@ void XMLTextParagraphExport::exportTextFootnote( SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, sXML_span, sal_False, sal_False ); exportTextFootnoteHelper(xFootnote, xText, sText, - bAutoStyles, bIsEndnote); + bAutoStyles, bIsEndnote, bProgress ); } else { exportTextFootnoteHelper(xFootnote, xText, sText, - bAutoStyles, bIsEndnote); + bAutoStyles, bIsEndnote, bProgress ); } } } @@ -202,11 +202,12 @@ void XMLTextParagraphExport::exportTextFootnoteHelper( const Reference<XText> & rText, const OUString& sText, sal_Bool bAutoStyles, - sal_Bool bIsEndnote) + sal_Bool bIsEndnote, + sal_Bool bProgress ) { if (bAutoStyles) { - exportText(rText, bAutoStyles); + exportText(rText, bAutoStyles, bProgress ); } else { @@ -246,7 +247,7 @@ void XMLTextParagraphExport::exportTextFootnoteHelper( (bIsEndnote ? sXML_endnote_body : sXML_footnote_body), sal_False, sal_False); - exportText(rText, bAutoStyles); + exportText(rText, bAutoStyles, bProgress ); } } } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index efe4d2888a30..97090ae3a9b0 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: sab $ $Date: 2000-11-20 16:51:29 $ + * last change: $Author: mib $ $Date: 2000-11-21 14:25:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -173,6 +173,9 @@ #ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX #include "XMLFontStylesContext.hxx" #endif +#ifndef _XMLOFF_PROGRESSBARHELPER_HXX +#include "ProgressBarHelper.hxx" +#endif using namespace ::rtl; @@ -423,7 +426,8 @@ static __FAR_DATA SvXMLTokenMapEntry aTextMasterPageElemTokenMap[] = XMLTextImportHelper::XMLTextImportHelper( const Reference < XModel >& rModel, - sal_Bool bInsertM, sal_Bool bStylesOnlyM ) : + sal_Bool bInsertM, sal_Bool bStylesOnlyM, + sal_Bool bPrg ) : pTextElemTokenMap( 0 ), pTextPElemTokenMap( 0 ), pTextPAttrTokenMap( 0 ), @@ -439,6 +443,7 @@ XMLTextImportHelper::XMLTextImportHelper( pOutlineStyles( 0 ), bInsertMode( bInsertM ), bStylesOnlyMode( bStylesOnlyM ), + bProgress( bPrg ), pFootnoteBackpatcher(NULL), pSequenceIdBackpatcher(NULL), pSequenceNameBackpatcher(NULL), @@ -961,6 +966,12 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext( pContext = new XMLParaContext( rImport, nPrefix, rLocalName, xAttrList, bHeading ); + if( bProgress && XML_TEXT_TYPE_SHAPE != eType ) + { + ProgressBarHelper *pProgress = rImport.GetProgressBarHelper(); + if( pProgress ) + pProgress->SetValue( ++nProgress ); + } break; case XML_TOK_TEXT_ORDERED_LIST: bOrdered = sal_True; diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 87df9785602d..38f34aaa541b 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparae.cxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: sab $ $Date: 2000-11-20 16:51:30 $ + * last change: $Author: mib $ $Date: 2000-11-21 14:25:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -190,6 +190,9 @@ #ifndef _XEXPTRANSFORM_HXX #include "xexptran.hxx" #endif +#ifndef _XMLOFF_PROGRESSBARHELPER_HXX +#include "ProgressBarHelper.hxx" +#endif #ifndef _XMLOFF_NMSPMAP_HXX #include "nmspmap.hxx" @@ -583,7 +586,8 @@ void XMLTextParagraphExport::exportListChange( XMLTextParagraphExport::XMLTextParagraphExport( SvXMLExport& rExp, - SvXMLAutoStylePoolP & rASP ) : + SvXMLAutoStylePoolP & rASP, + sal_Int32 nProg ) : XMLStyleExport( rExp, OUString(), &rASP ), // rExport( rExp ), rAutoStylePool( rASP ), @@ -665,7 +669,8 @@ XMLTextParagraphExport::XMLTextParagraphExport( sActualSize(RTL_CONSTASCII_USTRINGPARAM("ActualSize")), sContourPolyPolygon(RTL_CONSTASCII_USTRINGPARAM("ContourPolyPolygon")), sAnchorCharStyleName(RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")), - sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap")) + sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap")), + nProgress( nProg ) { UniReference < XMLPropertySetMapper > xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ); @@ -864,7 +869,8 @@ void XMLTextParagraphExport::collectFrames() } } -void XMLTextParagraphExport::exportPageFrames( sal_Bool bAutoStyles ) +void XMLTextParagraphExport::exportPageFrames( sal_Bool bAutoStyles, + sal_Bool bProgress ) { if( pPageTextFrameIdxs ) { @@ -874,7 +880,7 @@ void XMLTextParagraphExport::exportPageFrames( sal_Bool bAutoStyles ) Reference < XTextFrame > xTxtFrame; aAny >>= xTxtFrame; Reference < XTextContent > xTxtCntnt( xTxtFrame, UNO_QUERY ); - exportTextFrame( xTxtCntnt, bAutoStyles ); + exportTextFrame( xTxtCntnt, bAutoStyles, bProgress ); } } if( pPageGraphicIdxs ) @@ -902,7 +908,8 @@ void XMLTextParagraphExport::exportPageFrames( sal_Bool bAutoStyles ) void XMLTextParagraphExport::exportText( const Reference < XText > & rText, - sal_Bool bAutoStyles ) + sal_Bool bAutoStyles, + sal_Bool bProgress ) { Reference < XEnumerationAccess > xEA( rText, UNO_QUERY ); Reference < XEnumeration > xParaEnum = xEA->createEnumeration(); @@ -917,13 +924,15 @@ void XMLTextParagraphExport::exportText( aAny >>= xBaseSection; } } - exportTextContentEnumeration( xParaEnum, bAutoStyles, xBaseSection ); + exportTextContentEnumeration( xParaEnum, bAutoStyles, xBaseSection, + bProgress ); } void XMLTextParagraphExport::exportTextContentEnumeration( const Reference < XEnumeration > & rContEnum, sal_Bool bAutoStyles, - const Reference < XTextSection > & rBaseSection) + const Reference < XTextSection > & rBaseSection, + sal_Bool bProgress) { XMLTextNumRuleInfo aPrevNumInfo; XMLTextNumRuleInfo aNextNumInfo; @@ -949,7 +958,7 @@ void XMLTextParagraphExport::exportTextContentEnumeration( aPrevNumInfo, aNextNumInfo, bAutoStyles ); - exportParagraph( xTxtCntnt, bAutoStyles ); + exportParagraph( xTxtCntnt, bAutoStyles, bProgress ); bHasContent = sal_True; } else if( xServiceInfo->supportsService( sTableService ) ) @@ -963,12 +972,12 @@ void XMLTextParagraphExport::exportTextContentEnumeration( aPrevNumInfo, aNextNumInfo, bAutoStyles ); - exportTable( xTxtCntnt, bAutoStyles ); + exportTable( xTxtCntnt, bAutoStyles, bProgress ); bHasContent = sal_True; } else if( xServiceInfo->supportsService( sTextFrameService ) ) { - exportTextFrame( xTxtCntnt, bAutoStyles ); + exportTextFrame( xTxtCntnt, bAutoStyles, bProgress ); } else if( xServiceInfo->supportsService( sTextGraphicService ) ) { @@ -1006,10 +1015,16 @@ void XMLTextParagraphExport::exportTextContentEnumeration( void XMLTextParagraphExport::exportParagraph( const Reference < XTextContent > & rTextContent, - sal_Bool bAutoStyles ) + sal_Bool bAutoStyles, sal_Bool bProgress ) { sal_Int8 nOutlineLevel = -1; + if( bProgress ) + { + ProgressBarHelper *pProgress = GetExport().GetProgressBarHelper(); + pProgress->SetValue( ++nProgress ); + } + Reference < XPropertySet > xPropSet( rTextContent, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); @@ -1082,8 +1097,9 @@ void XMLTextParagraphExport::exportParagraph( if( bAutoStyles ) { if( xContentEnum.is() ) - exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection); - exportTextRangeEnumeration( xTextEnum, bAutoStyles ); + exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection, + bProgress ); + exportTextRangeEnumeration( xTextEnum, bAutoStyles, bProgress ); } else { @@ -1092,8 +1108,9 @@ void XMLTextParagraphExport::exportParagraph( SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, pElem, sal_True, sal_False ); if( xContentEnum.is() ) - exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection); - exportTextRangeEnumeration( xTextEnum, bAutoStyles ); + exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection, + bProgress ); + exportTextRangeEnumeration( xTextEnum, bAutoStyles, bProgress ); } } @@ -1108,7 +1125,7 @@ static const sal_Char* lcl_XmlBookmarkElements[] = { void XMLTextParagraphExport::exportTextRangeEnumeration( const Reference < XEnumeration > & rTextEnum, - sal_Bool bAutoStyles ) + sal_Bool bAutoStyles, sal_Bool bProgress ) { sal_Bool bPrevCharIsSpace = sal_True; @@ -1151,14 +1168,14 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( Reference<XTextSection> xSection; if( xContentEnum.is() ) exportTextContentEnumeration( xContentEnum, bAutoStyles, - xSection ); + xSection, bProgress ); bPrevCharIsSpace = sal_False; } else if (sType.equals(sFootnote)) { exportTextFootnote(xPropSet, xTxtRange->getString(), - bAutoStyles); + bAutoStyles, bProgress ); bPrevCharIsSpace = sal_False; } else if (sType.equals(sBookmark)) @@ -1202,7 +1219,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( void XMLTextParagraphExport::exportTable( const Reference < XTextContent > & rTextContent, - sal_Bool bAutoStyles ) + sal_Bool bAutoStyles, sal_Bool bProgress ) { } @@ -1470,7 +1487,8 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( void XMLTextParagraphExport::_exportTextFrame( const Reference < XPropertySet > & rPropSet, - const Reference < XPropertySetInfo > & rPropSetInfo ) + const Reference < XPropertySetInfo > & rPropSetInfo, + sal_Bool bProgress ) { Reference < XTextFrame > xTxtFrame( rPropSet, UNO_QUERY ); Reference < XText > xTxt = xTxtFrame->getText(); @@ -1503,12 +1521,13 @@ void XMLTextParagraphExport::_exportTextFrame( SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, sXML_text_box, sal_False, sal_True ); - exportText( xTxt, sal_False ); + exportText( xTxt, sal_False, bProgress ); } void XMLTextParagraphExport::exportTextFrame( const Reference < XTextContent > & rTxtCntnt, - sal_Bool bAutoStyles ) + sal_Bool bAutoStyles, + sal_Bool bProgress ) { Reference < XPropertySet > xPropSet( rTxtCntnt, UNO_QUERY ); @@ -1517,7 +1536,7 @@ void XMLTextParagraphExport::exportTextFrame( Reference < XTextFrame > xTxtFrame( rTxtCntnt, UNO_QUERY ); Reference < XText > xTxt = xTxtFrame->getText(); Add( XML_STYLE_FAMILY_TEXT_FRAME, xPropSet ); - exportText( xTxt, bAutoStyles ); + exportText( xTxt, bAutoStyles, bProgress ); } else { @@ -1532,11 +1551,11 @@ void XMLTextParagraphExport::exportTextFrame( addHyperlinkAttributes( xPropSet, xPropState, xPropSetInfo ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, sXML_a, sal_False, sal_False ); - _exportTextFrame( xPropSet, xPropSetInfo ); + _exportTextFrame( xPropSet, xPropSetInfo, bProgress ); } else { - _exportTextFrame( xPropSet, xPropSetInfo ); + _exportTextFrame( xPropSet, xPropSetInfo, bProgress ); } } } |