Kaydet (Commit) 9322327b authored tarafından Michael Brauer's avatar Michael Brauer

#80552#: progress bar and document statistics

üst c593ef15
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlexp.cxx,v $ * $RCSfile: xmlexp.cxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: dvo $ $Date: 2000-11-16 11:21:54 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:34 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -221,9 +221,9 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM, ...@@ -221,9 +221,9 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
_InitItemExport(); _InitItemExport();
if( bShowProgress ) // if( bShowProgress )
::StartProgress( STR_STATSTR_W4WWRITE, 0, pDoc->GetNodes().Count(), // ::StartProgress( STR_STATSTR_W4WWRITE, 0, pDoc->GetNodes().Count(),
pDoc->GetDocShell() ); // pDoc->GetDocShell() );
SfxObjectShell* pObjSh = pDoc->GetDocShell(); SfxObjectShell* pObjSh = pDoc->GetDocShell();
if( pObjSh ) if( pObjSh )
...@@ -242,8 +242,8 @@ XMLShapeExport* SwXMLExport::CreateShapeExport() ...@@ -242,8 +242,8 @@ XMLShapeExport* SwXMLExport::CreateShapeExport()
__EXPORT SwXMLExport::~SwXMLExport() __EXPORT SwXMLExport::~SwXMLExport()
{ {
if( bShowProgress ) // if( bShowProgress )
::EndProgress( pDoc->GetDocShell() ); // ::EndProgress( pDoc->GetDocShell() );
#ifdef XML_CORE_API #ifdef XML_CORE_API
if( pCurPaM ) if( pCurPaM )
...@@ -292,8 +292,8 @@ void SwXMLExport::_ExportContent() ...@@ -292,8 +292,8 @@ void SwXMLExport::_ExportContent()
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText(); Reference < XText > xText = xTextDoc->getText();
GetTextParagraphExport()->exportFramesBoundToPage(); GetTextParagraphExport()->exportFramesBoundToPage( bShowProgress );
GetTextParagraphExport()->exportText( xText ); GetTextParagraphExport()->exportText( xText, bShowProgress );
#endif #endif
} }
...@@ -343,8 +343,8 @@ void SwXMLExport::ExportCurPaM( sal_Bool bExportWholePaM ) ...@@ -343,8 +343,8 @@ void SwXMLExport::ExportCurPaM( sal_Bool bExportWholePaM )
pCurPaM->GetPoint()->nNode++; // next node pCurPaM->GetPoint()->nNode++; // next node
sal_uInt32 nPos = pCurPaM->GetPoint()->nNode.GetIndex(); sal_uInt32 nPos = pCurPaM->GetPoint()->nNode.GetIndex();
if( bShowProgress ) // if( bShowProgress )
::SetProgressState( nPos, pDoc->GetDocShell() ); // ::SetProgressState( nPos, pDoc->GetDocShell() );
// if not everything should be exported, the WriteAll flag must be // if not everything should be exported, the WriteAll flag must be
// set for all but the first and last node anyway. // set for all but the first and last node anyway.
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlexp.hxx,v $ * $RCSfile: xmlexp.hxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: dvo $ $Date: 2000-11-16 11:21:54 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -150,7 +150,7 @@ class SwXMLExport : public SvXMLExport ...@@ -150,7 +150,7 @@ class SwXMLExport : public SvXMLExport
void ExportTableLines( const SwTableLines& rLines, void ExportTableLines( const SwTableLines& rLines,
sal_Bool bHeadline=sal_False ); sal_Bool bHeadline=sal_False );
// virtual void _ExportMeta(); virtual void _ExportMeta();
virtual void _ExportFontDecls(); virtual void _ExportFontDecls();
virtual void _ExportStyles( sal_Bool bUsed ); virtual void _ExportStyles( sal_Bool bUsed );
virtual void _ExportAutoStyles(); virtual void _ExportAutoStyles();
...@@ -195,6 +195,8 @@ public: ...@@ -195,6 +195,8 @@ public:
} }
SwDoc& GetDoc() { return *pDoc; } SwDoc& GetDoc() { return *pDoc; }
sal_Bool IsShowProgress() const { return bShowProgress; }
}; };
inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlfmt.cxx,v $ * $RCSfile: xmlfmt.cxx,v $
* *
* $Revision: 1.7 $ * $Revision: 1.8 $
* *
* last change: $Author: dvo $ $Date: 2000-11-16 11:21:54 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1071,6 +1071,8 @@ SvXMLImportContext *SwXMLImport::CreateStylesContext( ...@@ -1071,6 +1071,8 @@ SvXMLImportContext *SwXMLImport::CreateStylesContext(
else else
xStyles = pContext; xStyles = pContext;
ShowProgress( bAuto ? 10 : 5 );
return pContext; return pContext;
} }
...@@ -1081,6 +1083,10 @@ SvXMLImportContext *SwXMLImport::CreateMasterStylesContext( ...@@ -1081,6 +1083,10 @@ SvXMLImportContext *SwXMLImport::CreateMasterStylesContext(
SvXMLImportContext *pContext = SvXMLImportContext *pContext =
new SwXMLMasterStylesContext_Impl( *this, XML_NAMESPACE_OFFICE, rLocalName, new SwXMLMasterStylesContext_Impl( *this, XML_NAMESPACE_OFFICE, rLocalName,
xAttrList ); xAttrList );
ShowProgress( 15 );
GetTextImport()->SetProgressValue( nProgress );
return pContext; return pContext;
} }
...@@ -1096,6 +1102,7 @@ void SwXMLImport::InsertStyles( sal_Bool bAuto ) ...@@ -1096,6 +1102,7 @@ void SwXMLImport::InsertStyles( sal_Bool bAuto )
GetTextImport()->SetAutoStyles( (SwXMLStylesContext_Impl *)&xAutoStyles ); GetTextImport()->SetAutoStyles( (SwXMLStylesContext_Impl *)&xAutoStyles );
GetShapeImport()->SetAutoStylesContext( (SwXMLStylesContext_Impl *)&xAutoStyles ); GetShapeImport()->SetAutoStylesContext( (SwXMLStylesContext_Impl *)&xAutoStyles );
} }
} }
void SwXMLImport::FinishStyles() void SwXMLImport::FinishStyles()
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlfmte.cxx,v $ * $RCSfile: xmlfmte.cxx,v $
* *
* $Revision: 1.7 $ * $Revision: 1.8 $
* *
* last change: $Author: dvo $ $Date: 2000-11-16 11:21:54 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -447,8 +447,8 @@ void SwXMLExport::_ExportAutoStyles() ...@@ -447,8 +447,8 @@ void SwXMLExport::_ExportAutoStyles()
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText(); Reference < XText > xText = xTextDoc->getText();
GetTextParagraphExport()->collectFrameBoundToPageAutoStyles(); GetTextParagraphExport()->collectFrameBoundToPageAutoStyles( bShowProgress );
GetTextParagraphExport()->collectTextAutoStyles( xText ); GetTextParagraphExport()->collectTextAutoStyles( xText, bShowProgress );
GetPageExport()->collectAutoStyles( sal_False ); GetPageExport()->collectAutoStyles( sal_False );
GetTextParagraphExport()->exportTextAutoStyles(); GetTextParagraphExport()->exportTextAutoStyles();
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlimp.cxx,v $ * $RCSfile: xmlimp.cxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: mib $ $Date: 2000-11-13 08:44:24 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -93,6 +93,9 @@ ...@@ -93,6 +93,9 @@
#ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_ #ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_
#include <xmloff/XMLFontStylesContext.hxx> #include <xmloff/XMLFontStylesContext.hxx>
#endif #endif
#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
#include <xmloff/ProgressBarHelper.hxx>
#endif
#ifndef _DOC_HXX #ifndef _DOC_HXX
#include <doc.hxx> #include <doc.hxx>
...@@ -269,7 +272,10 @@ SwXMLImport::SwXMLImport( ...@@ -269,7 +272,10 @@ SwXMLImport::SwXMLImport(
pDocElemTokenMap( 0 ), pDocElemTokenMap( 0 ),
pTableElemTokenMap( 0 ), pTableElemTokenMap( 0 ),
pTableItemMapper( 0 ), pTableItemMapper( 0 ),
pSttNdIdx( 0 ) pSttNdIdx( 0 ),
bProgressValid( sal_False ),
bShowProgress( sal_True ),
nProgress( 0 )
{ {
_InitItemImport(); _InitItemImport();
...@@ -480,3 +486,40 @@ XMLShapeImportHelper* SwXMLImport::CreateShapeImport() ...@@ -480,3 +486,40 @@ XMLShapeImportHelper* SwXMLImport::CreateShapeImport()
{ {
return new XMLTextShapeImportHelper( *this ); return new XMLTextShapeImportHelper( *this );
} }
void SwXMLImport::SetProgressRef( sal_Int32 nParagraphs )
{
if( bShowProgress && !bProgressValid )
{
if( !nParagraphs )
nParagraphs = 250; // We assume 250 paragarphs here
// We assume that
// - 5% are taken reading meta information and fonts
// - 5% are taken reading styles
// - 5% are taken reading automatic styles
// - 85% are taken reading the rest of the document
// The 85% correspond exactly to the number of paragarphs
// contained in the document
nProgressRef = (nParagraphs *100) / 85;
ProgressBarHelper *pProgress = GetProgressBarHelper();
if( pProgress )
pProgress->SetReference( nProgressRef );
bProgressValid = sal_True;
}
}
void SwXMLImport::ShowProgress( sal_Int32 nPercent )
{
if( bShowProgress)
{
if( !bProgressValid )
SetProgressRef( 0 );
nProgress = nPercent * nProgressRef / 100;
ProgressBarHelper *pProgress = GetProgressBarHelper();
if( pProgress )
pProgress->SetValue( nProgress );
}
}
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlimp.hxx,v $ * $RCSfile: xmlimp.hxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: mib $ $Date: 2000-11-07 14:05:53 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -101,17 +101,23 @@ class SwXMLImport: public SvXMLImport ...@@ -101,17 +101,23 @@ class SwXMLImport: public SvXMLImport
SvXMLImportContextRef xAutoStyles; SvXMLImportContextRef xAutoStyles;
sal_uInt16 nStyleFamilyMask;// Mask of styles to load sal_uInt16 nStyleFamilyMask;// Mask of styles to load
sal_Int32 nProgress;
sal_Int32 nProgressRef;
sal_Bool bLoadDoc : 1; // Load doc or styles only sal_Bool bLoadDoc : 1; // Load doc or styles only
sal_Bool bInsert : 1; // Insert mode. If styles are sal_Bool bInsert : 1; // Insert mode. If styles are
// loaded only sal_False means that // loaded only sal_False means that
// existing styles will be // existing styles will be
// overwritten. // overwritten.
sal_Bool bAutoStylesValid : 1; sal_Bool bAutoStylesValid : 1;
sal_Bool bProgressValid : 1;
sal_Bool bShowProgress : 1;
void _InitItemImport(); void _InitItemImport();
void _FinitItemImport(); void _FinitItemImport();
void ShowProgress( sal_Int32 nPercent );
void SetProgressRef( sal_Int32 nParagraphs );
protected: protected:
// This method is called after the namespace map has been updated, but // This method is called after the namespace map has been updated, but
...@@ -167,6 +173,8 @@ public: ...@@ -167,6 +173,8 @@ public:
const ::rtl::OUString& rName, const ::rtl::OUString& rName,
const SfxItemSet **ppItemSet=0, const SfxItemSet **ppItemSet=0,
::rtl::OUString *pParent=0 ) const; ::rtl::OUString *pParent=0 ) const;
virtual void SetStatisticAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs);
}; };
inline const SvXMLUnitConverter& SwXMLImport::GetTwipUnitConverter() const inline const SvXMLUnitConverter& SwXMLImport::GetTwipUnitConverter() const
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlmeta.cxx,v $ * $RCSfile: xmlmeta.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 17:15:00 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -85,28 +85,47 @@ ...@@ -85,28 +85,47 @@
#ifndef _XMLOFF_XMLMETAE_HXX #ifndef _XMLOFF_XMLMETAE_HXX
#include <xmloff/xmlmetae.hxx> #include <xmloff/xmlmetae.hxx>
#endif #endif
#ifndef _SVX_LANGITEM_HXX #ifndef _SVX_LANGITEM_HXX
#include <svx/langitem.hxx> #include <svx/langitem.hxx>
#endif #endif
#ifndef _XMLOFF_XMLUCONV_HXX
#include <xmloff/xmluconv.hxx>
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
#include <xmloff/nmspmap.hxx>
#endif
#ifndef _DOCSTAT_HXX
#include "docstat.hxx"
#endif
#ifndef _SWDOCSH_HXX #ifndef _SWDOCSH_HXX
#include "docsh.hxx" #include "docsh.hxx"
#endif #endif
#ifndef _DOC_HXX //autogen wg. SwDoc #ifndef _DOC_HXX //autogen wg. SwDoc
#include <doc.hxx> #include <doc.hxx>
#endif #endif
#ifndef _UNOOBJ_HXX
#include <unoobj.hxx>
#endif
#ifndef _XMLIMP_HXX #ifndef _XMLIMP_HXX
#include "xmlimp.hxx" #include "xmlimp.hxx"
#endif #endif
#ifndef _XMLOFF_XMLKYWD_HXX
#include <xmloff/xmlkywd.hxx>
#endif
#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
#include <xmloff/ProgressBarHelper.hxx>
#endif
#ifndef _XMLEXP_HXX #ifndef _XMLEXP_HXX
#include "xmlexp.hxx" #include "xmlexp.hxx"
#endif #endif
using namespace ::rtl; using namespace ::rtl;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
...@@ -143,19 +162,6 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext( ...@@ -143,19 +162,6 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext(
pContext = new SfxXMLMetaContext( *this, pContext = new SfxXMLMetaContext( *this,
XML_NAMESPACE_OFFICE, rLocalName, XML_NAMESPACE_OFFICE, rLocalName,
GetModel() ); GetModel() );
#if 0
SfxObjectShell* pObjSh = pDoc->GetDocShell();
if( pObjSh )
{
Reference< frame::XModel > xModel = pObjSh->GetBaseModel();
Reference< document::XDocumentInfoSupplier > xSupp( xModel,
UNO_QUERY );
if( xSupp.is() )
pContext = new SwXMLMetaContext_Impl( *this,
XML_NAMESPACE_OFFICE, rLocalName,
xSupp->getDocumentInfo() );
}
#endif
} }
if( !pContext ) if( !pContext )
...@@ -167,61 +173,148 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext( ...@@ -167,61 +173,148 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext(
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
#if 0 enum SvXMLTokenMapAttrs
void SwXMLExport::_ExportMeta()
{ {
SfxObjectShell* pObjSh = pDoc->GetDocShell(); XML_TOK_META_STAT_TABLE = 1,
if( pObjSh ) XML_TOK_META_STAT_IMAGE = 2,
{ XML_TOK_META_STAT_OLE = 4,
pObjSh->UpdateDocInfoForSave(); // update information XML_TOK_META_STAT_PAGE = 8,
XML_TOK_META_STAT_PARA = 16,
LanguageType eDocLang = ((const SvxLanguageItem&) XML_TOK_META_STAT_WORD = 32,
pDoc->GetDefault(RES_CHRATR_LANGUAGE)).GetLanguage(); XML_TOK_META_STAT_CHAR = 64,
XML_TOK_META_STAT_END=XML_TOK_UNKNOWN
};
Reference< frame::XModel > xModel = pObjSh->GetBaseModel(); static __FAR_DATA SvXMLTokenMapEntry aMetaStatAttrTokenMap[] =
Reference< document::XDocumentInfoSupplier > xSupp( xModel, {
UNO_QUERY ); { XML_NAMESPACE_META, sXML_table_count, XML_TOK_META_STAT_TABLE },
if( xSupp.is() ) { XML_NAMESPACE_META, sXML_image_count, XML_TOK_META_STAT_IMAGE },
{ XML_NAMESPACE_META, sXML_object_count, XML_TOK_META_STAT_OLE },
{ XML_NAMESPACE_META, sXML_paragraph_count, XML_TOK_META_STAT_PARA },
{ XML_NAMESPACE_META, sXML_page_count, XML_TOK_META_STAT_PAGE },
{ XML_NAMESPACE_META, sXML_word_count, XML_TOK_META_STAT_WORD },
{ XML_NAMESPACE_META, sXML_character_count, XML_TOK_META_STAT_CHAR },
XML_TOKEN_MAP_END
};
void SwXMLImport::SetStatisticAttributes(
const Reference< xml::sax::XAttributeList > & xAttrList)
{
if( IsStylesOnlyMode() || IsInsertMode() )
return;
Reference<XUnoTunnel> xCrsrTunnel( GetTextImport()->GetCursor(),
UNO_QUERY);
ASSERT( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" );
SwXTextCursor *pTxtCrsr = (SwXTextCursor*)xCrsrTunnel->getSomething(
SwXTextCursor::getUnoTunnelId() );
ASSERT( pTxtCrsr, "SwXTextCursor missing" );
SwDoc *pDoc = pTxtCrsr->GetDoc();
SwDocStat aDocStat( pDoc->GetDocStat() );
SvXMLTokenMap aTokenMap( aMetaStatAttrTokenMap );
sal_uInt32 nTokens = 0;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rValue = xAttrList->getValueByIndex( i );
sal_Int32 nValue;
if( !GetMM100UnitConverter().convertNumber( nValue, rValue ) )
continue;
const OUString& rAttrName = xAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
sal_uInt32 nToken = aTokenMap.Get( nPrefix, aLocalName );
switch( nToken )
{ {
SfxXMLMetaExport aMeta( GetDocHandler(), xSupp->getDocumentInfo(), case XML_TOK_META_STAT_TABLE:
eDocLang ); aDocStat.nTbl = (sal_uInt16)nValue;
aMeta.Export( GetNamespaceMap() ); break;
case XML_TOK_META_STAT_IMAGE:
aDocStat.nGrf = (sal_uInt16)nValue;
break;
case XML_TOK_META_STAT_OLE:
aDocStat.nOLE = (sal_uInt16)nValue;
break;
case XML_TOK_META_STAT_PAGE:
aDocStat.nPage = (sal_uInt32)nValue;
break;
case XML_TOK_META_STAT_PARA:
aDocStat.nPara = (sal_uInt32)nValue;
break;
case XML_TOK_META_STAT_WORD:
aDocStat.nWord = (sal_uInt32)nValue;
break;
case XML_TOK_META_STAT_CHAR:
aDocStat.nChar = (sal_uInt32)nValue;
break;
default:
nToken = 0;
} }
nTokens |= nToken;
} }
}
#endif
/*************************************************************************
Source Code Control chaos::System - Header
$Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/xmlmeta.cxx,v 1.1.1.1 2000-09-18 17:15:00 hr Exp $
Source Code Control chaos::System - Update
$Log: not supported by cvs2svn $
Revision 1.7 2000/09/18 16:05:07 willem.vandorp
OpenOffice header added.
Revision 1.6 2000/08/02 14:52:39 mib
text export continued
Revision 1.5 2000/06/08 09:45:54 aw
changed to use functionality from xmloff project now
Revision 1.4 2000/05/03 12:08:05 mib if( 127 == nTokens )
unicode aDocStat.bModified = sal_False;
if( nTokens )
Revision 1.3 2000/03/13 14:33:44 mib pDoc->SetDocStat( aDocStat );
UNO3 if( nTokens & XML_TOK_META_STAT_PARA )
SetProgressRef( (sal_Int32)aDocStat.nPara );
else if ( nTokens & XML_TOK_META_STAT_PAGE )
SetProgressRef( (sal_Int32)aDocStat.nPage * 10 );
}
Revision 1.2 2000/02/11 14:42:04 hr // ---------------------------------------------------------------------
#70473# changes for unicode ( patched by automated patchtool )
Revision 1.1 2000/01/06 15:03:49 mib void SwXMLExport::_ExportMeta()
#70271#:separation of text/layout, cond. styles, adaptions to wd-xlink-19991229 {
SvXMLExport::_ExportMeta();
SwDocStat aDocStat( GetDoc().GetDocStat() );
if( aDocStat.bModified )
GetDoc().UpdateDocStat( aDocStat
#if SUPD < 614
,0
#endif
);
*************************************************************************/ if( bShowProgress )
{
ProgressBarHelper *pProgress = GetProgressBarHelper();
pProgress->SetReference( 20 + 2*aDocStat.nPara );
pProgress->SetValue( 20 );
}
OUStringBuffer aOut(16);
aOut.append( (sal_Int32)aDocStat.nTbl );
AddAttribute( XML_NAMESPACE_META, sXML_table_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nGrf );
AddAttribute( XML_NAMESPACE_META, sXML_image_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nOLE );
AddAttribute( XML_NAMESPACE_META, sXML_object_count,
aOut.makeStringAndClear() );
if( aDocStat.nPage )
{
aOut.append( (sal_Int32)aDocStat.nPage );
AddAttribute( XML_NAMESPACE_META, sXML_page_count,
aOut.makeStringAndClear() );
}
aOut.append( (sal_Int32)aDocStat.nPara );
AddAttribute( XML_NAMESPACE_META, sXML_paragraph_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nWord );
AddAttribute( XML_NAMESPACE_META, sXML_word_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nChar );
AddAttribute( XML_NAMESPACE_META, sXML_character_count,
aOut.makeStringAndClear() );
SvXMLElementExport aElem( *this, XML_NAMESPACE_META,
sXML_document_statistic,
sal_True, sal_True );
}
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmltble.cxx,v $ * $RCSfile: xmltble.cxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: dvo $ $Date: 2000-11-16 11:21:54 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -846,7 +846,8 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, sal_uInt16 nColSpan ) ...@@ -846,7 +846,8 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, sal_uInt16 nColSpan )
sXML_table_cell, sal_True, sal_True ); sXML_table_cell, sal_True, sal_True );
// export cell content // export cell content
GetTextParagraphExport()->exportText( xRange->getText() ); GetTextParagraphExport()->exportText( xRange->getText(),
bShowProgress );
} }
else else
{ {
...@@ -1053,8 +1054,11 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd ) ...@@ -1053,8 +1054,11 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd )
void SwXMLTextParagraphExport::exportTable( void SwXMLTextParagraphExport::exportTable(
const Reference < XTextContent > & rTextContent, const Reference < XTextContent > & rTextContent,
sal_Bool bAutoStyles ) sal_Bool bAutoStyles, sal_Bool bProgress )
{ {
ASSERT( ((SwXMLExport&)GetExport()).IsShowProgress() == bProgress,
"inconsistent progress flags" );
// Reference < XPropertySet > xPropSet( rTextContent, UNO_QUERY ); // Reference < XPropertySet > xPropSet( rTextContent, UNO_QUERY );
// Any aAny = xPropSet->getPropertyValue( sTextTable ); // Any aAny = xPropSet->getPropertyValue( sTextTable );
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmltbli.cxx,v $ * $RCSfile: xmltbli.cxx,v $
* *
* $Revision: 1.9 $ * $Revision: 1.10 $
* *
* last change: $Author: dvo $ $Date: 2000-11-16 11:21:54 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -2157,7 +2157,7 @@ protected: ...@@ -2157,7 +2157,7 @@ protected:
public: public:
SwXMLTextImportHelper( SwXMLTextImportHelper(
const Reference < XModel>& rModel, const Reference < XModel>& rModel,
sal_Bool bInsertM, sal_Bool bStylesOnlyM ); sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress );
~SwXMLTextImportHelper(); ~SwXMLTextImportHelper();
virtual sal_Bool IsInHeaderFooter() const; virtual sal_Bool IsInHeaderFooter() const;
...@@ -2165,8 +2165,8 @@ public: ...@@ -2165,8 +2165,8 @@ public:
SwXMLTextImportHelper::SwXMLTextImportHelper( SwXMLTextImportHelper::SwXMLTextImportHelper(
const Reference < XModel>& rModel, const Reference < XModel>& rModel,
sal_Bool bInsertM, sal_Bool bStylesOnlyM ) : sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress ) :
XMLTextImportHelper( rModel, bInsertM, bStylesOnlyM ) XMLTextImportHelper( rModel, bInsertM, bStylesOnlyM, bProgress )
{ {
} }
...@@ -2200,5 +2200,5 @@ sal_Bool SwXMLTextImportHelper::IsInHeaderFooter() const ...@@ -2200,5 +2200,5 @@ sal_Bool SwXMLTextImportHelper::IsInHeaderFooter() const
XMLTextImportHelper* SwXMLImport::CreateTextImport() XMLTextImportHelper* SwXMLImport::CreateTextImport()
{ {
return new SwXMLTextImportHelper( GetModel(), IsInsertMode(), return new SwXMLTextImportHelper( GetModel(), IsInsertMode(),
IsStylesOnlyMode() ); IsStylesOnlyMode(), bShowProgress );
} }
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmltext.cxx,v $ * $RCSfile: xmltext.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: mib $ $Date: 2000-11-07 14:05:53 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -139,5 +139,11 @@ SvXMLImportContext *SwXMLImport::CreateBodyContext( ...@@ -139,5 +139,11 @@ SvXMLImportContext *SwXMLImport::CreateBodyContext(
pContext = new SvXMLImportContext( *this, XML_NAMESPACE_OFFICE, pContext = new SvXMLImportContext( *this, XML_NAMESPACE_OFFICE,
rLocalName ); rLocalName );
if( !bProgressValid )
{
ShowProgress( 15 );
GetTextImport()->SetProgressValue( nProgress );
}
return pContext; return pContext;
} }
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmltexte.hxx,v $ * $RCSfile: xmltexte.hxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: mib $ $Date: 2000-11-07 14:05:53 $ * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -86,7 +86,7 @@ protected: ...@@ -86,7 +86,7 @@ protected:
virtual void exportTable( virtual void exportTable(
const ::com::sun::star::uno::Reference < const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextContent > & rTextContent, ::com::sun::star::text::XTextContent > & rTextContent,
sal_Bool bAutoStyles ); sal_Bool bAutoStyles, sal_Bool bProgress );
public: public:
SwXMLTextParagraphExport( SwXMLTextParagraphExport(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment