Kaydet (Commit) 7e7c8a51 authored tarafından Michael Brauer's avatar Michael Brauer

#80552#: bug fixes for progress

üst 5676e088
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlexp.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
#ifndef _SWDOCSH_HXX #ifndef _SWDOCSH_HXX
#include <docsh.hxx> #include <docsh.hxx>
#endif #endif
#ifndef _DOCSTAT_HXX
#include "docstat.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX #ifndef _XMLOFF_NMSPMAP_HXX
...@@ -108,6 +111,9 @@ ...@@ -108,6 +111,9 @@
#ifndef _XMLOFF_XMLCNITM_HXX #ifndef _XMLOFF_XMLCNITM_HXX
#include <xmloff/xmlcnitm.hxx> #include <xmloff/xmlcnitm.hxx>
#endif #endif
#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
#include <xmloff/ProgressBarHelper.hxx>
#endif
#ifndef _XMLTEXTE_HXX #ifndef _XMLTEXTE_HXX
#include <xmltexte.hxx> #include <xmltexte.hxx>
...@@ -173,6 +179,7 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM, ...@@ -173,6 +179,7 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
#endif #endif
pTableItemMapper( 0 ), pTableItemMapper( 0 ),
pTableLines( 0 ), pTableLines( 0 ),
nContentProgressStart( 0 ),
bExportWholeDoc( bExpWholeDoc ), bExportWholeDoc( bExpWholeDoc ),
bExportFirstTableOnly( bExpFirstTableOnly ), bExportFirstTableOnly( bExpFirstTableOnly ),
bShowProgress( bShowProg ), bShowProgress( bShowProg ),
...@@ -221,9 +228,24 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM, ...@@ -221,9 +228,24 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
_InitItemExport(); _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(), // ::StartProgress( STR_STATSTR_W4WWRITE, 0, pDoc->GetNodes().Count(),
// pDoc->GetDocShell() ); // pDoc->GetDocShell() );
nContentProgressStart = (sal_Int32)aDocStat.nPara / 2;
ProgressBarHelper *pProgress = GetProgressBarHelper();
pProgress->SetReference( nContentProgressStart + 2*aDocStat.nPara );
pProgress->SetValue( 0 );
}
SfxObjectShell* pObjSh = pDoc->GetDocShell(); SfxObjectShell* pObjSh = pDoc->GetDocShell();
if( pObjSh ) if( pObjSh )
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlexp.hxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -124,6 +124,7 @@ class SwXMLExport : public SvXMLExport ...@@ -124,6 +124,7 @@ class SwXMLExport : public SvXMLExport
UniReference < XMLPropertySetMapper > xParaPropMapper; UniReference < XMLPropertySetMapper > xParaPropMapper;
// UniReference < XMLTextMasterPageExport> xMasterPageExport; // UniReference < XMLTextMasterPageExport> xMasterPageExport;
sal_Int32 nContentProgressStart;
sal_Bool bExportWholeDoc : 1;// export whole document? sal_Bool bExportWholeDoc : 1;// export whole document?
sal_Bool bExportFirstTableOnly : 1; sal_Bool bExportFirstTableOnly : 1;
sal_Bool bShowProgress : 1; sal_Bool bShowProgress : 1;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlfmte.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -137,6 +137,9 @@ ...@@ -137,6 +137,9 @@
#ifndef _XMLOFF_FAMILIES_HXX_ #ifndef _XMLOFF_FAMILIES_HXX_
#include <xmloff/families.hxx> #include <xmloff/families.hxx>
#endif #endif
#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
#include <xmloff/ProgressBarHelper.hxx>
#endif
#ifndef _FORMAT_HXX //autogen wg. SwFmt #ifndef _FORMAT_HXX //autogen wg. SwFmt
#include <format.hxx> #include <format.hxx>
...@@ -444,6 +447,12 @@ void SwXMLExport::_ExportStyles( sal_Bool bUsed ) ...@@ -444,6 +447,12 @@ void SwXMLExport::_ExportStyles( sal_Bool bUsed )
void SwXMLExport::_ExportAutoStyles() void SwXMLExport::_ExportAutoStyles()
{ {
if( bShowProgress )
{
ProgressBarHelper *pProgress = GetProgressBarHelper();
pProgress->SetValue( nContentProgressStart );
GetTextParagraphExport()->SetProgress( nContentProgressStart );
}
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText(); Reference < XText > xText = xTextDoc->getText();
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlmeta.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -273,22 +273,9 @@ void SwXMLExport::_ExportMeta() ...@@ -273,22 +273,9 @@ void SwXMLExport::_ExportMeta()
{ {
SvXMLExport::_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); OUStringBuffer aOut(16);
SwDocStat aDocStat( GetDoc().GetDocStat() );
aOut.append( (sal_Int32)aDocStat.nTbl ); aOut.append( (sal_Int32)aDocStat.nTbl );
AddAttribute( XML_NAMESPACE_META, sXML_table_count, AddAttribute( XML_NAMESPACE_META, sXML_table_count,
aOut.makeStringAndClear() ); aOut.makeStringAndClear() );
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmltbli.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -873,7 +873,7 @@ SV_IMPL_PTRARR(SwXMLTableRows_Impl,SwXMLTableRowPtr) ...@@ -873,7 +873,7 @@ SV_IMPL_PTRARR(SwXMLTableRows_Impl,SwXMLTableRowPtr)
SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow, SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow,
sal_uInt32 nCol ) const sal_uInt32 nCol ) const
{ {
return (*pRows)[nRow]->GetCell( nCol ); return (*pRows)[nRow]->GetCell( (sal_uInt16)nCol );
} }
TYPEINIT1( SwXMLTableContext, XMLTextTableContext ); TYPEINIT1( SwXMLTableContext, XMLTextTableContext );
...@@ -1084,7 +1084,7 @@ sal_Int32 SwXMLTableContext::GetColumnWidth( sal_uInt32 nCol, ...@@ -1084,7 +1084,7 @@ sal_Int32 SwXMLTableContext::GetColumnWidth( sal_uInt32 nCol,
nLast = aColumnWidths.Count(); nLast = aColumnWidths.Count();
sal_Int32 nWidth = 0L; 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]; nWidth += aColumnWidths[i];
return nWidth; return nWidth;
...@@ -1190,7 +1190,7 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName, ...@@ -1190,7 +1190,7 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName,
{ {
// The current row has already been inserted because of a row span // The current row has already been inserted because of a row span
// of a previous row. // of a previous row.
(*pRows)[nCurRow]->Set( rStyleName ); (*pRows)[(sal_uInt16)nCurRow]->Set( rStyleName );
} }
else else
{ {
...@@ -1274,7 +1274,7 @@ void SwXMLTableContext::FixRowSpan( sal_uInt32 nRow, sal_uInt32 nCol, ...@@ -1274,7 +1274,7 @@ void SwXMLTableContext::FixRowSpan( sal_uInt32 nRow, sal_uInt32 nCol,
sal_uInt32 nColSpan ) sal_uInt32 nColSpan )
{ {
sal_uInt32 nLastCol = nCol + 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 j = nRow;
sal_uInt32 nRowSpan = 1UL; sal_uInt32 nRowSpan = 1UL;
...@@ -1298,7 +1298,7 @@ void SwXMLTableContext::ReplaceWithEmptyCell( sal_uInt32 nRow, sal_uInt32 nCol ) ...@@ -1298,7 +1298,7 @@ void SwXMLTableContext::ReplaceWithEmptyCell( sal_uInt32 nRow, sal_uInt32 nCol )
for( sal_uInt32 i=nRow; i<nLastRow; i++ ) 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++ ) for( sal_uInt32 j=nCol; j<nLastCol; j++ )
pRow->GetCell( j )->SetStartNode( pSttNd ); pRow->GetCell( j )->SetStartNode( pSttNd );
} }
...@@ -1503,7 +1503,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, ...@@ -1503,7 +1503,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
pFrmFmt->SetAttr( aFillOrder ); pFrmFmt->SetAttr( aFillOrder );
const SfxItemSet *pAutoItemSet = 0; const SfxItemSet *pAutoItemSet = 0;
const OUString& rStyleName = (*pRows)[nTopRow]->GetStyleName(); const OUString& rStyleName = (*pRows)[(sal_uInt16)nTopRow]->GetStyleName();
if( 1UL == (nBottomRow - nTopRow) && if( 1UL == (nBottomRow - nTopRow) &&
rStyleName.getLength() && rStyleName.getLength() &&
GetSwImport().FindAutomaticStyle( GetSwImport().FindAutomaticStyle(
...@@ -1681,7 +1681,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1681,7 +1681,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
} }
} }
for( i=(sal_uInt32)pRows->Count()-1UL; i>=nCurRow; i-- ) 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. // Make sure there is at least one column.
...@@ -1705,8 +1705,8 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1705,8 +1705,8 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
sal_uInt32 nRelCols = 0UL; sal_uInt32 nRelCols = 0UL;
for( i=0U; i < nCols; i++ ) for( i=0U; i < nCols; i++ )
{ {
sal_Int32 nColWidth = aColumnWidths[i]; sal_Int32 nColWidth = aColumnWidths[(sal_uInt16)i];
if( aColumnRelWidths[i] ) if( aColumnRelWidths[(sal_uInt16)i] )
{ {
nRelWidth += nColWidth; nRelWidth += nColWidth;
if( 0L == nMinRelColWidth || nColWidth < nMinRelColWidth ) if( 0L == nMinRelColWidth || nColWidth < nMinRelColWidth )
...@@ -1740,7 +1740,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1740,7 +1740,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
{ {
if( !aColumnRelWidths[(sal_uInt16)i] ) if( !aColumnRelWidths[(sal_uInt16)i] )
{ {
sal_Int32 nRelCol = (aColumnWidths[i] * nMinRelColWidth) / sal_Int32 nRelCol = (aColumnWidths[(sal_uInt16)i] * nMinRelColWidth) /
nMinAbsColWidth; nMinAbsColWidth;
aColumnWidths.Replace( (sal_uInt16)nRelCol, (sal_uInt16)i ); aColumnWidths.Replace( (sal_uInt16)nRelCol, (sal_uInt16)i );
nRelWidth += nRelCol; nRelWidth += nRelCol;
...@@ -1762,12 +1762,12 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1762,12 +1762,12 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
nRelWidth = 0L; nRelWidth = 0L;
for( i=0U; i < nCols-1UL; i++ ) for( i=0U; i < nCols-1UL; i++ )
{ {
sal_Int32 nW = (sal_Int32)(aColumnWidths[i] * n); sal_Int32 nW = (sal_Int32)(aColumnWidths[(sal_uInt16)i] * n);
aColumnWidths.Replace( (sal_uInt16)nW, i ); aColumnWidths.Replace( (sal_uInt16)nW, (sal_uInt16)i );
nRelWidth += nW; nRelWidth += nW;
} }
aColumnWidths.Replace( (sal_uInt16)(nWidth-nRelWidth), aColumnWidths.Replace( (sal_uInt16)(nWidth-nRelWidth),
(sal_uInt16)nCols-1UL ); (sal_uInt16)nCols-1U );
} }
} }
else else
...@@ -1835,13 +1835,13 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1835,13 +1835,13 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
else if( bMinExtra ) else if( bMinExtra )
{ {
sal_Int32 nExtraRelCol = sal_Int32 nExtraRelCol =
aColumnWidths[i] - nMinRelColWidth; aColumnWidths[(sal_uInt16)i] - nMinRelColWidth;
nAbsCol = MINLAY + (nExtraRelCol * nExtraAbs) / nAbsCol = MINLAY + (nExtraRelCol * nExtraAbs) /
nExtraRel; nExtraRel;
} }
else else
{ {
nAbsCol = (aColumnWidths[i] * nAbsForRelWidth) / nAbsCol = (aColumnWidths[(sal_uInt16)i] * nAbsForRelWidth) /
nRelWidth; nRelWidth;
} }
} }
...@@ -1862,11 +1862,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1862,11 +1862,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
aColumnWidths[(sal_uInt16)nCols-1U] + nExtraAbs; aColumnWidths[(sal_uInt16)nCols-1U] + nExtraAbs;
for( i=0UL; i < nCols-1UL; i++ ) for( i=0UL; i < nCols-1UL; i++ )
{ {
sal_Int32 nAbsCol = aColumnWidths[i]; sal_Int32 nAbsCol = aColumnWidths[(sal_uInt16)i];
sal_Int32 nExtraAbsCol = (nAbsCol * nExtraAbs) / sal_Int32 nExtraAbsCol = (nAbsCol * nExtraAbs) /
nAbsWidth; nAbsWidth;
nAbsCol += nExtraAbsCol; nAbsCol += nExtraAbsCol;
aColumnWidths.Replace( (sal_uInt16)nAbsCol, i ); aColumnWidths.Replace( (sal_uInt16)nAbsCol, (sal_uInt16)i );
nAbsLastCol -= nExtraAbsCol; nAbsLastCol -= nExtraAbsCol;
} }
aColumnWidths.Replace( (sal_uInt16)nAbsLastCol, (sal_uInt16)nCols-1U ); aColumnWidths.Replace( (sal_uInt16)nAbsLastCol, (sal_uInt16)nCols-1U );
...@@ -1880,11 +1880,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox ) ...@@ -1880,11 +1880,11 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
sal_Int32 nAbsLastCol = MINLAY + nExtraAbs; sal_Int32 nAbsLastCol = MINLAY + nExtraAbs;
for( i=0UL; i < nCols-1UL; i++ ) for( i=0UL; i < nCols-1UL; i++ )
{ {
sal_Int32 nAbsCol = aColumnWidths[i]; sal_Int32 nAbsCol = aColumnWidths[(sal_uInt16)i];
sal_Int32 nExtraAbsCol = (nAbsCol * nExtraAbs) / sal_Int32 nExtraAbsCol = (nAbsCol * nExtraAbs) /
nAbsWidth; nAbsWidth;
nAbsCol = MINLAY + nExtraAbsCol; nAbsCol = MINLAY + nExtraAbsCol;
aColumnWidths.Replace( (sal_uInt16)nAbsCol, i ); aColumnWidths.Replace( (sal_uInt16)nAbsCol, (sal_uInt16)i );
nAbsLastCol -= nExtraAbsCol; nAbsLastCol -= nExtraAbsCol;
} }
aColumnWidths.Replace( (sal_uInt16)nAbsLastCol, (sal_uInt16)nCols-1U ); aColumnWidths.Replace( (sal_uInt16)nAbsLastCol, (sal_uInt16)nCols-1U );
...@@ -2003,7 +2003,7 @@ void SwXMLTableContext::MakeTable() ...@@ -2003,7 +2003,7 @@ void SwXMLTableContext::MakeTable()
else else
{ {
nWidth = pSize->GetWidth(); nWidth = pSize->GetWidth();
if( nWidth < GetColumnCount() * MINLAY ) if( nWidth < (sal_Int32)GetColumnCount() * MINLAY )
{ {
nWidth = GetColumnCount() * MINLAY; nWidth = GetColumnCount() * MINLAY;
} }
......
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