summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brauer <mib@openoffice.org>2000-11-23 13:42:38 +0000
committerMichael Brauer <mib@openoffice.org>2000-11-23 13:42:38 +0000
commit7e7c8a51f05ef2c7c56b26e27328ad4b30655740 (patch)
tree8fc00969636676a36b6bcc2f5f8d579f15ce2957
parent5676e088da238c010f19ddf77278caf4d1f29e03 (diff)
#80552#: bug fixes for progress
-rw-r--r--sw/source/filter/xml/xmlexp.cxx28
-rw-r--r--sw/source/filter/xml/xmlexp.hxx5
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx13
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx19
-rw-r--r--sw/source/filter/xml/xmltbli.cxx44
5 files changed, 64 insertions, 45 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index dae548cf30eb..b1f5c8ef9494 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexp.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mib $ $Date: 2000-11-21 14:38:34 $
+ * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,9 @@
#ifndef _SWDOCSH_HXX
#include <docsh.hxx>
#endif
+#ifndef _DOCSTAT_HXX
+#include "docstat.hxx"
+#endif
#ifndef _XMLOFF_NMSPMAP_HXX
@@ -108,6 +111,9 @@
#ifndef _XMLOFF_XMLCNITM_HXX
#include <xmloff/xmlcnitm.hxx>
#endif
+#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
+#include <xmloff/ProgressBarHelper.hxx>
+#endif
#ifndef _XMLTEXTE_HXX
#include <xmltexte.hxx>
@@ -173,6 +179,7 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
#endif
pTableItemMapper( 0 ),
pTableLines( 0 ),
+ nContentProgressStart( 0 ),
bExportWholeDoc( bExpWholeDoc ),
bExportFirstTableOnly( bExpFirstTableOnly ),
bShowProgress( bShowProg ),
@@ -221,9 +228,24 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
_InitItemExport();
-// if( bShowProgress )
+ // Update doc stat, so that correct values are exported and
+ // the progress works correctly.
+ SwDocStat aDocStat( GetDoc().GetDocStat() );
+ if( aDocStat.bModified )
+ GetDoc().UpdateDocStat( aDocStat
+#if SUPD < 614
+ ,0
+#endif
+ );
+ if( bShowProgress )
+ {
// ::StartProgress( STR_STATSTR_W4WWRITE, 0, pDoc->GetNodes().Count(),
// pDoc->GetDocShell() );
+ nContentProgressStart = (sal_Int32)aDocStat.nPara / 2;
+ ProgressBarHelper *pProgress = GetProgressBarHelper();
+ pProgress->SetReference( nContentProgressStart + 2*aDocStat.nPara );
+ pProgress->SetValue( 0 );
+ }
SfxObjectShell* pObjSh = pDoc->GetDocShell();
if( pObjSh )
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 381df6a1aade..16dbaf66dc96 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexp.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
+ * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -124,6 +124,7 @@ class SwXMLExport : public SvXMLExport
UniReference < XMLPropertySetMapper > xParaPropMapper;
// UniReference < XMLTextMasterPageExport> xMasterPageExport;
+ sal_Int32 nContentProgressStart;
sal_Bool bExportWholeDoc : 1;// export whole document?
sal_Bool bExportFirstTableOnly : 1;
sal_Bool bShowProgress : 1;
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 5fd91330f0d6..6f426c1b93d5 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlfmte.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
+ * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,9 @@
#ifndef _XMLOFF_FAMILIES_HXX_
#include <xmloff/families.hxx>
#endif
+#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
+#include <xmloff/ProgressBarHelper.hxx>
+#endif
#ifndef _FORMAT_HXX //autogen wg. SwFmt
#include <format.hxx>
@@ -444,6 +447,12 @@ void SwXMLExport::_ExportStyles( sal_Bool bUsed )
void SwXMLExport::_ExportAutoStyles()
{
+ if( bShowProgress )
+ {
+ ProgressBarHelper *pProgress = GetProgressBarHelper();
+ pProgress->SetValue( nContentProgressStart );
+ GetTextParagraphExport()->SetProgress( nContentProgressStart );
+ }
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index ca5750d4411d..a24e270a4905 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlmeta.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
+ * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -273,22 +273,9 @@ void SwXMLExport::_ExportMeta()
{
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);
+ SwDocStat aDocStat( GetDoc().GetDocStat() );
aOut.append( (sal_Int32)aDocStat.nTbl );
AddAttribute( XML_NAMESPACE_META, sXML_table_count,
aOut.makeStringAndClear() );
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 2af5f2164a1c..a21b9234bb2e 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltbli.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
+ * last change: $Author: mib $ $Date: 2000-11-23 14:42:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -873,7 +873,7 @@ SV_IMPL_PTRARR(SwXMLTableRows_Impl,SwXMLTableRowPtr)
SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow,
sal_uInt32 nCol ) const
{
- return (*pRows)[nRow]->GetCell( nCol );
+ return (*pRows)[nRow]->GetCell( (sal_uInt16)nCol );
}
TYPEINIT1( SwXMLTableContext, XMLTextTableContext );
@@ -1084,7 +1084,7 @@ sal_Int32 SwXMLTableContext::GetColumnWidth( sal_uInt32 nCol,
nLast = aColumnWidths.Count();
sal_Int32 nWidth = 0L;
- for( sal_uInt16 i=nCol; i < nLast; i++ )
+ for( sal_uInt16 i=(sal_uInt16)nCol; i < nLast; i++ )
nWidth += aColumnWidths[i];
return nWidth;
@@ -1190,7 +1190,7 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName,
{
// The current row has already been inserted because of a row span
// of a previous row.
- (*pRows)[nCurRow]->Set( rStyleName );
+ (*pRows)[(sal_uInt16)nCurRow]->Set( rStyleName );
}
else
{
@@ -1274,7 +1274,7 @@ void SwXMLTableContext::FixRowSpan( sal_uInt32 nRow, sal_uInt32 nCol,
sal_uInt32 nColSpan )
{
sal_uInt32 nLastCol = nCol + nColSpan;
- for( sal_uInt16 i = nCol; i < nLastCol; i++ )
+ for( sal_uInt16 i = (sal_uInt16)nCol; i < nLastCol; i++ )
{
sal_uInt32 j = nRow;
sal_uInt32 nRowSpan = 1UL;
@@ -1298,7 +1298,7 @@ void SwXMLTableContext::ReplaceWithEmptyCell( sal_uInt32 nRow, sal_uInt32 nCol )
for( sal_uInt32 i=nRow; i<nLastRow; i++ )
{
- SwXMLTableRow_Impl *pRow = (*pRows)[i];
+ SwXMLTableRow_Impl *pRow = (*pRows)[(sal_uInt16)i];
for( sal_uInt32 j=nCol; j<nLastCol; j++ )
pRow->GetCell( j )->SetStartNode( pSttNd );
}
@@ -1503,7 +1503,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
pFrmFmt->SetAttr( aFillOrder );
const SfxItemSet *pAutoItemSet = 0;
- const OUString& rStyleName = (*pRows)[nTopRow]->GetStyleName();
+ const OUString& rStyleName = (*pRows)[(sal_uInt16)nTopRow]->GetStyleName();
if( 1UL == (nBottomRow - nTopRow) &&
rStyleName.getLength() &&
GetSwImport().FindAutomaticStyle(
@@ -1681,7 +1681,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
}
}
for( i=(sal_uInt32)pRows->Count()-1UL; i>=nCurRow; i-- )
- pRows->DeleteAndDestroy( i );
+ pRows->DeleteAndDestroy( (sal_uInt16)i );
}
// Make sure there is at least one column.
@@ -1705,8 +1705,8 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
sal_uInt32 nRelCols = 0UL;
for( i=0U; i < nCols; i++ )
{
- sal_Int32 nColWidth = aColumnWidths[i];
- if( aColumnRelWidths[i] )
+ sal_Int32 nColWidth = aColumnWidths[(sal_uInt16)i];
+ if( aColumnRelWidths[(sal_uInt16)i] )
{
nRelWidth += nColWidth;
if( 0L == nMinRelColWidth || nColWidth < nMinRelColWidth )
@@ -1740,7 +1740,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
{
if( !aColumnRelWidths[(sal_uInt16)i] )
{
- sal_Int32 nRelCol = (aColumnWidths[i] * nMinRelColWidth) /
+ sal_Int32 nRelCol = (aColumnWidths[(sal_uInt16)i] * nMinRelColWidth) /
nMinAbsColWidth;
aColumnWidths.Replace( (sal_uInt16)nRelCol, (sal_uInt16)i );
nRelWidth += nRelCol;
@@ -1762,12 +1762,12 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
nRelWidth = 0L;
for( i=0U; i < nCols-1UL; i++ )
{
- sal_Int32 nW = (sal_Int32)(aColumnWidths[i] * n);
- aColumnWidths.Replace( (sal_uInt16)nW, i );
+ sal_Int32 nW = (sal_Int32)(aColumnWidths[(sal_uInt16)i] * n);
+ aColumnWidths.Replace( (sal_uInt16)nW, (sal_uInt16)i );
nRelWidth += nW;
}
aColumnWidths.Replace( (sal_uInt16)(nWidth-nRelWidth),
- (sal_uInt16)nCols-1UL );
+ (sal_uInt16)nCols-1U );
}
}
else
@@ -1835,13 +1835,13 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
else if( bMinExtra )
{
sal_Int32 nExtraRelCol =
- aColumnWidths[i] - nMinRelColWidth;
+ aColumnWidths[(sal_uInt16)i] - nMinRelColWidth;
nAbsCol = MINLAY + (nExtraRelCol * nExtraAbs) /
nExtraRel;
}
else
{
- nAbsCol = (aColumnWidths[i] * nAbsForRelWidth) /
+ nAbsCol = (aColumnWidths[(sal_uInt16)i] * nAbsForRelWidth) /
nRelWidth;
}
}
@@ -1862,11 +1862,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
aColumnWidths[(sal_uInt16)nCols-1U] + nExtraAbs;
for( i=0UL; i < nCols-1UL; i++ )
{
- sal_Int32 nAbsCol = aColumnWidths[i];
+ sal_Int32 nAbsCol = aColumnWidths[(sal_uInt16)i];
sal_Int32 nExtraAbsCol = (nAbsCol * nExtraAbs) /
nAbsWidth;
nAbsCol += nExtraAbsCol;
- aColumnWidths.Replace( (sal_uInt16)nAbsCol, i );
+ aColumnWidths.Replace( (sal_uInt16)nAbsCol, (sal_uInt16)i );
nAbsLastCol -= nExtraAbsCol;
}
aColumnWidths.Replace( (sal_uInt16)nAbsLastCol, (sal_uInt16)nCols-1U );
@@ -1880,11 +1880,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
sal_Int32 nAbsLastCol = MINLAY + nExtraAbs;
for( i=0UL; i < nCols-1UL; i++ )
{
- sal_Int32 nAbsCol = aColumnWidths[i];
+ sal_Int32 nAbsCol = aColumnWidths[(sal_uInt16)i];
sal_Int32 nExtraAbsCol = (nAbsCol * nExtraAbs) /
nAbsWidth;
nAbsCol = MINLAY + nExtraAbsCol;
- aColumnWidths.Replace( (sal_uInt16)nAbsCol, i );
+ aColumnWidths.Replace( (sal_uInt16)nAbsCol, (sal_uInt16)i );
nAbsLastCol -= nExtraAbsCol;
}
aColumnWidths.Replace( (sal_uInt16)nAbsLastCol, (sal_uInt16)nCols-1U );
@@ -2003,7 +2003,7 @@ void SwXMLTableContext::MakeTable()
else
{
nWidth = pSize->GetWidth();
- if( nWidth < GetColumnCount() * MINLAY )
+ if( nWidth < (sal_Int32)GetColumnCount() * MINLAY )
{
nWidth = GetColumnCount() * MINLAY;
}