summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-02-23 15:33:07 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-02-23 15:33:07 -0500
commite1f75279ee368b62d528b63ce0085453ca65768a (patch)
treeb0bf3aec4ed398d5494e86aedf1328673601ceb0
parent3aeb34649fb15f829095496ae22f3167cb10b093 (diff)
calctabcolor: Reduce indent levels by early bailout.
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx857
1 files changed, 430 insertions, 427 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index ca286a980f96..6c969e36a46a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2152,498 +2152,501 @@ uno::Any lcl_GetEnumerated( uno::Reference<container::XEnumerationAccess> xEnumA
void ScXMLExport::_ExportAutoStyles()
{
- if (GetModel().is())
+ if (!GetModel().is())
+ // no model to export.
+ return;
+
+ uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetModel(), uno::UNO_QUERY );
+ if (!xSpreadDoc.is())
+ // no spreadsheet document to export.
+ return;
+
+ uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
+ if (!xIndex.is())
+ // no sheets to export.
+ return;
+
+ if (getExportFlags() & EXPORT_CONTENT)
{
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetModel(), uno::UNO_QUERY );
- if ( xSpreadDoc.is() )
+ // re-create automatic styles with old names from stored data
+ ScSheetSaveData* pSheetData = ScModelObj::getImplementation(xSpreadDoc)->GetSheetSaveData();
+ if (pSheetData && pDoc)
{
- uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
- if ( xIndex.is() )
- {
- if (getExportFlags() & EXPORT_CONTENT)
+ // formulas have to be calculated now, to detect changed results
+ // (during normal save, they will be calculated anyway)
+ SCTAB nTabCount = pDoc->GetTableCount();
+ for (SCTAB nTab=0; nTab<nTabCount; ++nTab)
+ if (pDoc->IsStreamValid(nTab))
{
- // re-create automatic styles with old names from stored data
- ScSheetSaveData* pSheetData = ScModelObj::getImplementation(xSpreadDoc)->GetSheetSaveData();
- if (pSheetData && pDoc)
+ ScCellIterator aIter( pDoc, 0,0,nTab, MAXCOL,MAXROW,nTab );
+ ScBaseCell* pCell = aIter.GetFirst();
+ while (pCell)
{
- // formulas have to be calculated now, to detect changed results
- // (during normal save, they will be calculated anyway)
- SCTAB nTabCount = pDoc->GetTableCount();
- for (SCTAB nTab=0; nTab<nTabCount; ++nTab)
- if (pDoc->IsStreamValid(nTab))
- {
- ScCellIterator aIter( pDoc, 0,0,nTab, MAXCOL,MAXROW,nTab );
- ScBaseCell* pCell = aIter.GetFirst();
- while (pCell)
- {
- if (pCell->GetCellType() == CELLTYPE_FORMULA)
- static_cast<ScFormulaCell*>(pCell)->IsValue(); // interpret if dirty
- pCell = aIter.GetNext();
- }
- }
+ if (pCell->GetCellType() == CELLTYPE_FORMULA)
+ static_cast<ScFormulaCell*>(pCell)->IsValue(); // interpret if dirty
+ pCell = aIter.GetNext();
+ }
+ }
- // stored cell styles
- const std::vector<ScCellStyleEntry>& rCellEntries = pSheetData->GetCellStyles();
- std::vector<ScCellStyleEntry>::const_iterator aCellIter = rCellEntries.begin();
- std::vector<ScCellStyleEntry>::const_iterator aCellEnd = rCellEntries.end();
- while (aCellIter != aCellEnd)
- {
- ScAddress aPos = aCellIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference <beans::XPropertySet> xProperties(
- xTable->getCellByPosition( aPos.Col(), aPos.Row() ), uno::UNO_QUERY );
+ // stored cell styles
+ const std::vector<ScCellStyleEntry>& rCellEntries = pSheetData->GetCellStyles();
+ std::vector<ScCellStyleEntry>::const_iterator aCellIter = rCellEntries.begin();
+ std::vector<ScCellStyleEntry>::const_iterator aCellEnd = rCellEntries.end();
+ while (aCellIter != aCellEnd)
+ {
+ ScAddress aPos = aCellIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ uno::Reference <beans::XPropertySet> xProperties(
+ xTable->getCellByPosition( aPos.Col(), aPos.Row() ), uno::UNO_QUERY );
- AddStyleFromCells(xProperties, xTable, nTable, &aCellIter->maName);
- }
- ++aCellIter;
- }
+ AddStyleFromCells(xProperties, xTable, nTable, &aCellIter->maName);
+ }
+ ++aCellIter;
+ }
- // stored column styles
- const std::vector<ScCellStyleEntry>& rColumnEntries = pSheetData->GetColumnStyles();
- std::vector<ScCellStyleEntry>::const_iterator aColumnIter = rColumnEntries.begin();
- std::vector<ScCellStyleEntry>::const_iterator aColumnEnd = rColumnEntries.end();
- while (aColumnIter != aColumnEnd)
- {
- ScAddress aPos = aColumnIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- uno::Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
- uno::Reference<beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex( aPos.Col() ), uno::UNO_QUERY);
+ // stored column styles
+ const std::vector<ScCellStyleEntry>& rColumnEntries = pSheetData->GetColumnStyles();
+ std::vector<ScCellStyleEntry>::const_iterator aColumnIter = rColumnEntries.begin();
+ std::vector<ScCellStyleEntry>::const_iterator aColumnEnd = rColumnEntries.end();
+ while (aColumnIter != aColumnEnd)
+ {
+ ScAddress aPos = aColumnIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ uno::Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ uno::Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
+ uno::Reference<beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex( aPos.Col() ), uno::UNO_QUERY);
- sal_Int32 nIndex(-1);
- sal_Bool bIsVisible(sal_True);
- AddStyleFromColumn( xColumnProperties, &aColumnIter->maName, nIndex, bIsVisible );
- }
- ++aColumnIter;
- }
+ sal_Int32 nIndex(-1);
+ sal_Bool bIsVisible(sal_True);
+ AddStyleFromColumn( xColumnProperties, &aColumnIter->maName, nIndex, bIsVisible );
+ }
+ ++aColumnIter;
+ }
- // stored row styles
- const std::vector<ScCellStyleEntry>& rRowEntries = pSheetData->GetRowStyles();
- std::vector<ScCellStyleEntry>::const_iterator aRowIter = rRowEntries.begin();
- std::vector<ScCellStyleEntry>::const_iterator aRowEnd = rRowEntries.end();
- while (aRowIter != aRowEnd)
- {
- ScAddress aPos = aRowIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- uno::Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
- uno::Reference<beans::XPropertySet> xRowProperties(xTableRows->getByIndex( aPos.Row() ), uno::UNO_QUERY);
+ // stored row styles
+ const std::vector<ScCellStyleEntry>& rRowEntries = pSheetData->GetRowStyles();
+ std::vector<ScCellStyleEntry>::const_iterator aRowIter = rRowEntries.begin();
+ std::vector<ScCellStyleEntry>::const_iterator aRowEnd = rRowEntries.end();
+ while (aRowIter != aRowEnd)
+ {
+ ScAddress aPos = aRowIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ uno::Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ uno::Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
+ uno::Reference<beans::XPropertySet> xRowProperties(xTableRows->getByIndex( aPos.Row() ), uno::UNO_QUERY);
- sal_Int32 nIndex(-1);
- AddStyleFromRow( xRowProperties, &aRowIter->maName, nIndex );
- }
- ++aRowIter;
- }
+ sal_Int32 nIndex(-1);
+ AddStyleFromRow( xRowProperties, &aRowIter->maName, nIndex );
+ }
+ ++aRowIter;
+ }
- // stored table styles
- const std::vector<ScCellStyleEntry>& rTableEntries = pSheetData->GetTableStyles();
- std::vector<ScCellStyleEntry>::const_iterator aTableIter = rTableEntries.begin();
- std::vector<ScCellStyleEntry>::const_iterator aTableEnd = rTableEntries.end();
- while (aTableIter != aTableEnd)
- {
- ScAddress aPos = aTableIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- //! separate method AddStyleFromTable needed?
- uno::Reference<beans::XPropertySet> xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- if (xTableProperties.is())
- {
- std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
- rtl::OUString sParent;
- rtl::OUString sName( aTableIter->maName );
- GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TABLE_TABLE, sParent, xPropStates);
- GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_TABLE, sName);
- }
- }
- ++aTableIter;
- }
+ // stored table styles
+ const std::vector<ScCellStyleEntry>& rTableEntries = pSheetData->GetTableStyles();
+ std::vector<ScCellStyleEntry>::const_iterator aTableIter = rTableEntries.begin();
+ std::vector<ScCellStyleEntry>::const_iterator aTableEnd = rTableEntries.end();
+ while (aTableIter != aTableEnd)
+ {
+ ScAddress aPos = aTableIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ //! separate method AddStyleFromTable needed?
+ uno::Reference<beans::XPropertySet> xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ if (xTableProperties.is())
+ {
+ std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
+ rtl::OUString sParent;
+ rtl::OUString sName( aTableIter->maName );
+ GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TABLE_TABLE, sParent, xPropStates);
+ GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_TABLE, sName);
+ }
+ }
+ ++aTableIter;
+ }
+
+ // stored styles for notes
- // stored styles for notes
+ UniReference<SvXMLExportPropertyMapper> xShapeMapper = XMLShapeExport::CreateShapePropMapper( *this );
+ GetShapeExport(); // make sure the graphics styles family is added
- UniReference<SvXMLExportPropertyMapper> xShapeMapper = XMLShapeExport::CreateShapePropMapper( *this );
- GetShapeExport(); // make sure the graphics styles family is added
+ const std::vector<ScNoteStyleEntry>& rNoteEntries = pSheetData->GetNoteStyles();
+ std::vector<ScNoteStyleEntry>::const_iterator aNoteIter = rNoteEntries.begin();
+ std::vector<ScNoteStyleEntry>::const_iterator aNoteEnd = rNoteEntries.end();
+ while (aNoteIter != aNoteEnd)
+ {
+ ScAddress aPos = aNoteIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ //! separate method AddStyleFromNote needed?
- const std::vector<ScNoteStyleEntry>& rNoteEntries = pSheetData->GetNoteStyles();
- std::vector<ScNoteStyleEntry>::const_iterator aNoteIter = rNoteEntries.begin();
- std::vector<ScNoteStyleEntry>::const_iterator aNoteEnd = rNoteEntries.end();
- while (aNoteIter != aNoteEnd)
+ ScPostIt* pNote = pDoc->GetNote( aPos );
+ DBG_ASSERT( pNote, "note not found" );
+ if (pNote)
+ {
+ SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
+ // all uno shapes are created anyway in CollectSharedData
+ uno::Reference<beans::XPropertySet> xShapeProperties( pDrawObj->getUnoShape(), uno::UNO_QUERY );
+ if (xShapeProperties.is())
{
- ScAddress aPos = aNoteIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
+ if ( aNoteIter->maStyleName.getLength() )
{
- //! separate method AddStyleFromNote needed?
-
- ScPostIt* pNote = pDoc->GetNote( aPos );
- DBG_ASSERT( pNote, "note not found" );
- if (pNote)
- {
- SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
- // all uno shapes are created anyway in CollectSharedData
- uno::Reference<beans::XPropertySet> xShapeProperties( pDrawObj->getUnoShape(), uno::UNO_QUERY );
- if (xShapeProperties.is())
- {
- if ( aNoteIter->maStyleName.getLength() )
- {
- std::vector<XMLPropertyState> xPropStates(xShapeMapper->Filter(xShapeProperties));
- rtl::OUString sParent;
- rtl::OUString sName( aNoteIter->maStyleName );
- GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_SD_GRAPHICS_ID, sParent, xPropStates);
- GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_SD_GRAPHICS_ID, sName);
- }
- if ( aNoteIter->maTextStyle.getLength() )
- {
- std::vector<XMLPropertyState> xPropStates(
- GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(xShapeProperties));
- rtl::OUString sParent;
- rtl::OUString sName( aNoteIter->maTextStyle );
- GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_PARAGRAPH, sParent, xPropStates);
- GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_PARAGRAPH, sName);
- }
- }
- }
+ std::vector<XMLPropertyState> xPropStates(xShapeMapper->Filter(xShapeProperties));
+ rtl::OUString sParent;
+ rtl::OUString sName( aNoteIter->maStyleName );
+ GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_SD_GRAPHICS_ID, sParent, xPropStates);
+ GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_SD_GRAPHICS_ID, sName);
+ }
+ if ( aNoteIter->maTextStyle.getLength() )
+ {
+ std::vector<XMLPropertyState> xPropStates(
+ GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(xShapeProperties));
+ rtl::OUString sParent;
+ rtl::OUString sName( aNoteIter->maTextStyle );
+ GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_PARAGRAPH, sParent, xPropStates);
+ GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_PARAGRAPH, sName);
}
- ++aNoteIter;
}
+ }
+ }
+ ++aNoteIter;
+ }
- // note paragraph styles
+ // note paragraph styles
- //UniReference<SvXMLExportPropertyMapper> xParaPropMapper = XMLTextParagraphExport::CreateParaExtPropMapper( *this );
- UniReference<SvXMLExportPropertyMapper> xParaPropMapper = GetTextParagraphExport()->GetParagraphPropertyMapper();
+ //UniReference<SvXMLExportPropertyMapper> xParaPropMapper = XMLTextParagraphExport::CreateParaExtPropMapper( *this );
+ UniReference<SvXMLExportPropertyMapper> xParaPropMapper = GetTextParagraphExport()->GetParagraphPropertyMapper();
- const std::vector<ScTextStyleEntry>& rNoteParaEntries = pSheetData->GetNoteParaStyles();
- std::vector<ScTextStyleEntry>::const_iterator aNoteParaIter = rNoteParaEntries.begin();
- std::vector<ScTextStyleEntry>::const_iterator aNoteParaEnd = rNoteParaEntries.end();
- while (aNoteParaIter != aNoteParaEnd)
+ const std::vector<ScTextStyleEntry>& rNoteParaEntries = pSheetData->GetNoteParaStyles();
+ std::vector<ScTextStyleEntry>::const_iterator aNoteParaIter = rNoteParaEntries.begin();
+ std::vector<ScTextStyleEntry>::const_iterator aNoteParaEnd = rNoteParaEntries.end();
+ while (aNoteParaIter != aNoteParaEnd)
+ {
+ ScAddress aPos = aNoteParaIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ ScPostIt* pNote = pDoc->GetNote( aPos );
+ DBG_ASSERT( pNote, "note not found" );
+ if (pNote)
+ {
+ SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
+ uno::Reference<container::XEnumerationAccess> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xParaProp(
+ lcl_GetEnumerated( xCellText, aNoteParaIter->maSelection.nStartPara ), uno::UNO_QUERY );
+ if ( xParaProp.is() )
{
- ScAddress aPos = aNoteParaIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- ScPostIt* pNote = pDoc->GetNote( aPos );
- DBG_ASSERT( pNote, "note not found" );
- if (pNote)
- {
- SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
- uno::Reference<container::XEnumerationAccess> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xParaProp(
- lcl_GetEnumerated( xCellText, aNoteParaIter->maSelection.nStartPara ), uno::UNO_QUERY );
- if ( xParaProp.is() )
- {
- std::vector<XMLPropertyState> xPropStates(xParaPropMapper->Filter(xParaProp));
- rtl::OUString sParent;
- rtl::OUString sName( aNoteParaIter->maName );
- GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_PARAGRAPH, sParent, xPropStates);
- GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_PARAGRAPH, sName);
- }
- }
- }
- ++aNoteParaIter;
+ std::vector<XMLPropertyState> xPropStates(xParaPropMapper->Filter(xParaProp));
+ rtl::OUString sParent;
+ rtl::OUString sName( aNoteParaIter->maName );
+ GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_PARAGRAPH, sParent, xPropStates);
+ GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_PARAGRAPH, sName);
}
+ }
+ }
+ ++aNoteParaIter;
+ }
- // note text styles
+ // note text styles
- UniReference<SvXMLExportPropertyMapper> xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this );
+ UniReference<SvXMLExportPropertyMapper> xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this );
- const std::vector<ScTextStyleEntry>& rNoteTextEntries = pSheetData->GetNoteTextStyles();
- std::vector<ScTextStyleEntry>::const_iterator aNoteTextIter = rNoteTextEntries.begin();
- std::vector<ScTextStyleEntry>::const_iterator aNoteTextEnd = rNoteTextEntries.end();
- while (aNoteTextIter != aNoteTextEnd)
+ const std::vector<ScTextStyleEntry>& rNoteTextEntries = pSheetData->GetNoteTextStyles();
+ std::vector<ScTextStyleEntry>::const_iterator aNoteTextIter = rNoteTextEntries.begin();
+ std::vector<ScTextStyleEntry>::const_iterator aNoteTextEnd = rNoteTextEntries.end();
+ while (aNoteTextIter != aNoteTextEnd)
+ {
+ ScAddress aPos = aNoteTextIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ ScPostIt* pNote = pDoc->GetNote( aPos );
+ DBG_ASSERT( pNote, "note not found" );
+ if (pNote)
+ {
+ SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
+ uno::Reference<text::XSimpleText> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
+ ScDrawTextCursor* pCursor = ScDrawTextCursor::getImplementation( xCursorProp );
+ if (pCursor)
{
- ScAddress aPos = aNoteTextIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- ScPostIt* pNote = pDoc->GetNote( aPos );
- DBG_ASSERT( pNote, "note not found" );
- if (pNote)
- {
- SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
- uno::Reference<text::XSimpleText> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
- ScDrawTextCursor* pCursor = ScDrawTextCursor::getImplementation( xCursorProp );
- if (pCursor)
- {
- pCursor->SetSelection( aNoteTextIter->maSelection );
+ pCursor->SetSelection( aNoteTextIter->maSelection );
- std::vector<XMLPropertyState> xPropStates(xTextPropMapper->Filter(xCursorProp));
- rtl::OUString sParent;
- rtl::OUString sName( aNoteTextIter->maName );
- GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_TEXT, sParent, xPropStates);
- GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_TEXT, sName);
- }
- }
- }
- ++aNoteTextIter;
+ std::vector<XMLPropertyState> xPropStates(xTextPropMapper->Filter(xCursorProp));
+ rtl::OUString sParent;
+ rtl::OUString sName( aNoteTextIter->maName );
+ GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_TEXT, sParent, xPropStates);
+ GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_TEXT, sName);
}
+ }
+ }
+ ++aNoteTextIter;
+ }
- // stored text styles
+ // stored text styles
- //UniReference<SvXMLExportPropertyMapper> xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this );
+ //UniReference<SvXMLExportPropertyMapper> xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this );
- const std::vector<ScTextStyleEntry>& rTextEntries = pSheetData->GetTextStyles();
- std::vector<ScTextStyleEntry>::const_iterator aTextIter = rTextEntries.begin();
- std::vector<ScTextStyleEntry>::const_iterator aTextEnd = rTextEntries.end();
- while (aTextIter != aTextEnd)
- {
- ScAddress aPos = aTextIter->maCellPos;
- sal_Int32 nTable = aPos.Tab();
- bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
- if (bCopySheet)
- {
- //! separate method AddStyleFromText needed?
- //! cache sheet object
-
- uno::Reference<table::XCellRange> xCellRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference<text::XSimpleText> xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
- ScCellTextCursor* pCursor = ScCellTextCursor::getImplementation( xCursorProp );
- if (pCursor)
- {
- pCursor->SetSelection( aTextIter->maSelection );
+ const std::vector<ScTextStyleEntry>& rTextEntries = pSheetData->GetTextStyles();
+ std::vector<ScTextStyleEntry>::const_iterator aTextIter = rTextEntries.begin();
+ std::vector<ScTextStyleEntry>::const_iterator aTextEnd = rTextEntries.end();
+ while (aTextIter != aTextEnd)
+ {
+ ScAddress aPos = aTextIter->maCellPos;
+ sal_Int32 nTable = aPos.Tab();
+ bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
+ if (bCopySheet)
+ {
+ //! separate method AddStyleFromText needed?
+ //! cache sheet object
+
+ uno::Reference<table::XCellRange> xCellRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ uno::Reference<text::XSimpleText> xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
+ ScCellTextCursor* pCursor = ScCellTextCursor::getImplementation( xCursorProp );
+ if (pCursor)
+ {
+ pCursor->SetSelection( aTextIter->maSelection );
- std::vector<XMLPropertyState> xPropStates(xTextPropMapper->Filter(xCursorProp));
- rtl::OUString sParent;
- rtl::OUString sName( aTextIter->maName );
- GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_TEXT, sParent, xPropStates);
- GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_TEXT, sName);
- }
- }
- ++aTextIter;
- }
+ std::vector<XMLPropertyState> xPropStates(xTextPropMapper->Filter(xCursorProp));
+ rtl::OUString sParent;
+ rtl::OUString sName( aTextIter->maName );
+ GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_TEXT, sParent, xPropStates);
+ GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_TEXT, sName);
}
+ }
+ ++aTextIter;
+ }
+ }
- ExportExternalRefCacheStyles();
+ ExportExternalRefCacheStyles();
- if (!pSharedData)
+ if (!pSharedData)
+ {
+ sal_Int32 nTableCount(0);
+ sal_Int32 nShapesCount(0);
+ sal_Int32 nCellCount(pDoc ? pDoc->GetCellCount() : 0);
+ CollectSharedData(nTableCount, nShapesCount, nCellCount);
+ //DBG_ERROR("no shared data setted");
+ }
+ sal_Int32 nTableCount(xIndex->getCount());
+ pCellStyles->AddNewTable(nTableCount - 1);
+ CollectShapesAutoStyles(nTableCount);
+ for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable)
+ {
+ bool bUseStream = pSheetData && pDoc && pDoc->IsStreamValid((SCTAB)nTable) &&
+ pSheetData->HasStreamPos(nTable) && xSourceStream.is();
+
+ uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ if (xTable.is())
+ {
+ // table styles array must be complete, including copied tables - Add should find the stored style
+ uno::Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY);
+ if (xTableProperties.is())
+ {
+ std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
+ if(xPropStates.size())
{
- sal_Int32 nTableCount(0);
- sal_Int32 nShapesCount(0);
- sal_Int32 nCellCount(pDoc ? pDoc->GetCellCount() : 0);
- CollectSharedData(nTableCount, nShapesCount, nCellCount);
- //DBG_ERROR("no shared data setted");
+ rtl::OUString sParent;
+ rtl::OUString sName;
+ GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_TABLE, sParent, xPropStates);
+ aTableStyles.push_back(sName);
}
- sal_Int32 nTableCount(xIndex->getCount());
- pCellStyles->AddNewTable(nTableCount - 1);
- CollectShapesAutoStyles(nTableCount);
- for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable)
+ }
+ }
+ // collect other auto-styles only for non-copied sheets
+ if (xTable.is() && !bUseStream)
+ {
+ uno::Reference<sheet::XUniqueCellFormatRangesSupplier> xCellFormatRanges ( xTable, uno::UNO_QUERY );
+ if ( xCellFormatRanges.is() )
+ {
+ uno::Reference<container::XIndexAccess> xFormatRangesIndex(xCellFormatRanges->getUniqueCellFormatRanges());
+ if (xFormatRangesIndex.is())
{
- bool bUseStream = pSheetData && pDoc && pDoc->IsStreamValid((SCTAB)nTable) &&
- pSheetData->HasStreamPos(nTable) && xSourceStream.is();
-
- uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- if (xTable.is())
+ sal_Int32 nFormatRangesCount(xFormatRangesIndex->getCount());
+ GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nFormatRangesCount);
+ for (sal_Int32 nFormatRange = 0; nFormatRange < nFormatRangesCount; ++nFormatRange)
{
- // table styles array must be complete, including copied tables - Add should find the stored style
- uno::Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY);
- if (xTableProperties.is())
+ uno::Reference< sheet::XSheetCellRanges> xCellRanges(xFormatRangesIndex->getByIndex(nFormatRange), uno::UNO_QUERY);
+ if (xCellRanges.is())
{
- std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
- if(xPropStates.size())
+ uno::Reference <beans::XPropertySet> xProperties (xCellRanges, uno::UNO_QUERY);
+ if (xProperties.is())
{
- rtl::OUString sParent;
- rtl::OUString sName;
- GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_TABLE, sParent, xPropStates);
- aTableStyles.push_back(sName);
+ AddStyleFromCells(xProperties, xTable, nTable, NULL);
+ IncrementProgressBar(sal_False);
}
}
}
- // collect other auto-styles only for non-copied sheets
- if (xTable.is() && !bUseStream)
+ }
+ }
+ uno::Reference<table::XColumnRowRange> xColumnRowRange (xTable, uno::UNO_QUERY);
+ if (xColumnRowRange.is())
+ {
+ if (pDoc)
+ {
+ uno::Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
+ if (xTableColumns.is())
{
- uno::Reference<sheet::XUniqueCellFormatRangesSupplier> xCellFormatRanges ( xTable, uno::UNO_QUERY );
- if ( xCellFormatRanges.is() )
+ sal_Int32 nColumns(pDoc->GetLastChangedCol(sal::static_int_cast<SCTAB>(nTable)));
+ pSharedData->SetLastColumn(nTable, nColumns);
+ table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
+ if (aCellAddress.EndColumn > nColumns)
{
- uno::Reference<container::XIndexAccess> xFormatRangesIndex(xCellFormatRanges->getUniqueCellFormatRanges());
- if (xFormatRangesIndex.is())
- {
- sal_Int32 nFormatRangesCount(xFormatRangesIndex->getCount());
- GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nFormatRangesCount);
- for (sal_Int32 nFormatRange = 0; nFormatRange < nFormatRangesCount; ++nFormatRange)
- {
- uno::Reference< sheet::XSheetCellRanges> xCellRanges(xFormatRangesIndex->getByIndex(nFormatRange), uno::UNO_QUERY);
- if (xCellRanges.is())
- {
- uno::Reference <beans::XPropertySet> xProperties (xCellRanges, uno::UNO_QUERY);
- if (xProperties.is())
- {
- AddStyleFromCells(xProperties, xTable, nTable, NULL);
- IncrementProgressBar(sal_False);
- }
- }
- }
- }
+ ++nColumns;
+ pColumnStyles->AddNewTable(nTable, aCellAddress.EndColumn);
}
- uno::Reference<table::XColumnRowRange> xColumnRowRange (xTable, uno::UNO_QUERY);
- if (xColumnRowRange.is())
+// else if (nColumns < MAXCOL)
+// pColumnStyles->AddNewTable(nTable, ++nColumns);
+ else
+ pColumnStyles->AddNewTable(nTable, nColumns);
+ sal_Int32 nColumn = 0;
+ while (/*nColumn <= nColumns && */nColumn <= MAXCOL)
{
- if (pDoc)
+ sal_Int32 nIndex(-1);
+ sal_Bool bIsVisible(sal_True);
+ uno::Reference <beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex(nColumn), uno::UNO_QUERY);
+ if (xColumnProperties.is())
{
- uno::Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
- if (xTableColumns.is())
- {
- sal_Int32 nColumns(pDoc->GetLastChangedCol(sal::static_int_cast<SCTAB>(nTable)));
- pSharedData->SetLastColumn(nTable, nColumns);
- table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
- if (aCellAddress.EndColumn > nColumns)
- {
- ++nColumns;
- pColumnStyles->AddNewTable(nTable, aCellAddress.EndColumn);
- }
- // else if (nColumns < MAXCOL)
- // pColumnStyles->AddNewTable(nTable, ++nColumns);
- else
- pColumnStyles->AddNewTable(nTable, nColumns);
- sal_Int32 nColumn = 0;
- while (/*nColumn <= nColumns && */nColumn <= MAXCOL)
- {
- sal_Int32 nIndex(-1);
- sal_Bool bIsVisible(sal_True);
- uno::Reference <beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex(nColumn), uno::UNO_QUERY);
- if (xColumnProperties.is())
- {
- AddStyleFromColumn( xColumnProperties, NULL, nIndex, bIsVisible );
- //if(xPropStates.size())
- pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible);
- }
- sal_Int32 nOld(nColumn);
- nColumn = pDoc->GetNextDifferentChangedCol(sal::static_int_cast<SCTAB>(nTable), static_cast<USHORT>(nColumn));
- for (sal_Int32 i = nOld + 1; i < nColumn; ++i)
- pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
- }
- if (aCellAddress.EndColumn > nColumns)
- {
- sal_Bool bIsVisible(sal_True);
- sal_Int32 nIndex(pColumnStyles->GetStyleNameIndex(nTable, nColumns, bIsVisible));
- for (sal_Int32 i = nColumns + 1; i <= aCellAddress.EndColumn; ++i)
- pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
- }
- }
- uno::Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
- if (xTableRows.is())
- {
- sal_Int32 nRows(pDoc->GetLastChangedRow(sal::static_int_cast<SCTAB>(nTable)));
- pSharedData->SetLastRow(nTable, nRows);
- table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
- if (aCellAddress.EndRow > nRows)
- {
- ++nRows;
- pRowStyles->AddNewTable(nTable, aCellAddress.EndRow);
- }
- // else if (nRows < MAXROW)
- // pRowStyles->AddNewTable(nTable, ++nRows);
- else
- pRowStyles->AddNewTable(nTable, nRows);
- sal_Int32 nRow = 0;
- while ( /*nRow <= nRows && */nRow <= MAXROW)
- {
- sal_Int32 nIndex = 0;
- uno::Reference <beans::XPropertySet> xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY);
- if(xRowProperties.is())
- {
- AddStyleFromRow( xRowProperties, NULL, nIndex );
- //if(xPropStates.size())
- pRowStyles->AddFieldStyleName(nTable, nRow, nIndex);
- }
- sal_Int32 nOld(nRow);
- nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<USHORT>(nRow), false);
- for (sal_Int32 i = nOld + 1; i < nRow; ++i)
- pRowStyles->AddFieldStyleName(nTable, i, nIndex);
- }
- if (aCellAddress.EndRow > nRows)
- {
- sal_Int32 nIndex(pRowStyles->GetStyleNameIndex(nTable, nRows));
- for (sal_Int32 i = nRows + 1; i <= aCellAddress.EndRow; ++i)
- pRowStyles->AddFieldStyleName(nTable, i, nIndex);
- }
- }
+ AddStyleFromColumn( xColumnProperties, NULL, nIndex, bIsVisible );
+ //if(xPropStates.size())
+ pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible);
}
+ sal_Int32 nOld(nColumn);
+ nColumn = pDoc->GetNextDifferentChangedCol(sal::static_int_cast<SCTAB>(nTable), static_cast<USHORT>(nColumn));
+ for (sal_Int32 i = nOld + 1; i < nColumn; ++i)
+ pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
}
- uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery (xTable, uno::UNO_QUERY);
- if (xCellRangesQuery.is())
+ if (aCellAddress.EndColumn > nColumns)
{
- uno::Reference<sheet::XSheetCellRanges> xSheetCellRanges(xCellRangesQuery->queryContentCells(sheet::CellFlags::FORMATTED));
- uno::Reference<sheet::XSheetOperation> xSheetOperation(xSheetCellRanges, uno::UNO_QUERY);
- if (xSheetCellRanges.is() && xSheetOperation.is())
+ sal_Bool bIsVisible(sal_True);
+ sal_Int32 nIndex(pColumnStyles->GetStyleNameIndex(nTable, nColumns, bIsVisible));
+ for (sal_Int32 i = nColumns + 1; i <= aCellAddress.EndColumn; ++i)
+ pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
+ }
+ }
+ uno::Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
+ if (xTableRows.is())
+ {
+ sal_Int32 nRows(pDoc->GetLastChangedRow(sal::static_int_cast<SCTAB>(nTable)));
+ pSharedData->SetLastRow(nTable, nRows);
+ table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
+ if (aCellAddress.EndRow > nRows)
+ {
+ ++nRows;
+ pRowStyles->AddNewTable(nTable, aCellAddress.EndRow);
+ }
+// else if (nRows < MAXROW)
+// pRowStyles->AddNewTable(nTable, ++nRows);
+ else
+ pRowStyles->AddNewTable(nTable, nRows);
+ sal_Int32 nRow = 0;
+ while ( /*nRow <= nRows && */nRow <= MAXROW)
+ {
+ sal_Int32 nIndex = 0;
+ uno::Reference <beans::XPropertySet> xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY);
+ if(xRowProperties.is())
{
- sal_uInt32 nCount(sal_uInt32(xSheetOperation->computeFunction(sheet::GeneralFunction_COUNT)));
- uno::Reference<container::XEnumerationAccess> xCellsAccess(xSheetCellRanges->getCells());
- if (xCellsAccess.is())
- {
- GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nCount);
- uno::Reference<container::XEnumeration> xCells(xCellsAccess->createEnumeration());
- if (xCells.is())
- {
- sal_uInt32 nCount2(0);
- while (xCells->hasMoreElements())
- {
- uno::Reference<text::XText> xText(xCells->nextElement(), uno::UNO_QUERY);
- if (xText.is())
- GetTextParagraphExport()->collectTextAutoStyles(xText, sal_False, sal_False);
- ++nCount2;
- IncrementProgressBar(sal_False);
- }
- if(nCount2 > nCount)
- GetProgressBarHelper()->SetReference(GetProgressBarHelper()->GetReference() + nCount2 - nCount);
- }
- }
+ AddStyleFromRow( xRowProperties, NULL, nIndex );
+ //if(xPropStates.size())
+ pRowStyles->AddFieldStyleName(nTable, nRow, nIndex);
}
+ sal_Int32 nOld(nRow);
+ nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<USHORT>(nRow), false);
+ for (sal_Int32 i = nOld + 1; i < nRow; ++i)
+ pRowStyles->AddFieldStyleName(nTable, i, nIndex);
+ }
+ if (aCellAddress.EndRow > nRows)
+ {
+ sal_Int32 nIndex(pRowStyles->GetStyleNameIndex(nTable, nRows));
+ for (sal_Int32 i = nRows + 1; i <= aCellAddress.EndRow; ++i)
+ pRowStyles->AddFieldStyleName(nTable, i, nIndex);
}
}
- IncrementProgressBar(sal_False);
- }
- pChangeTrackingExportHelper->CollectAutoStyles();
-
- GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN,
- GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
- GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW,
- GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
- GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE,
- GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
- exportAutoDataStyles();
- GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL,
- GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
-
- GetShapeExport()->exportAutoStyles();
- GetFormExport()->exportAutoStyles( );
-
- {
- // Special table style for the external ref cache tables.
- AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sExternalRefTabStyleName);
- AddAttribute(XML_NAMESPACE_STYLE, XML_FAMILY, XML_TABLE);
- SvXMLElementExport aElemStyle(*this, XML_NAMESPACE_STYLE, XML_STYLE, sal_True, sal_True);
- AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, XML_FALSE);
- SvXMLElementExport aElemStyleTabProps(*this, XML_NAMESPACE_STYLE, XML_TABLE_PROPERTIES, sal_True, sal_True);
}
}
- if (getExportFlags() & EXPORT_MASTERSTYLES)
+ uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery (xTable, uno::UNO_QUERY);
+ if (xCellRangesQuery.is())
{
- GetPageExport()->collectAutoStyles(sal_True);
- GetPageExport()->exportAutoStyles();
+ uno::Reference<sheet::XSheetCellRanges> xSheetCellRanges(xCellRangesQuery->queryContentCells(sheet::CellFlags::FORMATTED));
+ uno::Reference<sheet::XSheetOperation> xSheetOperation(xSheetCellRanges, uno::UNO_QUERY);
+ if (xSheetCellRanges.is() && xSheetOperation.is())
+ {
+ sal_uInt32 nCount(sal_uInt32(xSheetOperation->computeFunction(sheet::GeneralFunction_COUNT)));
+ uno::Reference<container::XEnumerationAccess> xCellsAccess(xSheetCellRanges->getCells());
+ if (xCellsAccess.is())
+ {
+ GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nCount);
+ uno::Reference<container::XEnumeration> xCells(xCellsAccess->createEnumeration());
+ if (xCells.is())
+ {
+ sal_uInt32 nCount2(0);
+ while (xCells->hasMoreElements())
+ {
+ uno::Reference<text::XText> xText(xCells->nextElement(), uno::UNO_QUERY);
+ if (xText.is())
+ GetTextParagraphExport()->collectTextAutoStyles(xText, sal_False, sal_False);
+ ++nCount2;
+ IncrementProgressBar(sal_False);
+ }
+ if(nCount2 > nCount)
+ GetProgressBarHelper()->SetReference(GetProgressBarHelper()->GetReference() + nCount2 - nCount);
+ }
+ }
+ }
}
+ }
+ IncrementProgressBar(sal_False);
+ }
+ pChangeTrackingExportHelper->CollectAutoStyles();
- // #i30251#; only write Text Styles once
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN,
+ GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW,
+ GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE,
+ GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
+ exportAutoDataStyles();
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL,
+ GetDocHandler(), GetMM100UnitConverter(), GetNamespaceMap());
- if ((getExportFlags() & EXPORT_CONTENT) || (getExportFlags() & EXPORT_MASTERSTYLES))
- GetTextParagraphExport()->exportTextAutoStyles();
- }
+ GetShapeExport()->exportAutoStyles();
+ GetFormExport()->exportAutoStyles( );
+
+ {
+ // Special table style for the external ref cache tables.
+ AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sExternalRefTabStyleName);
+ AddAttribute(XML_NAMESPACE_STYLE, XML_FAMILY, XML_TABLE);
+ SvXMLElementExport aElemStyle(*this, XML_NAMESPACE_STYLE, XML_STYLE, sal_True, sal_True);
+ AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, XML_FALSE);
+ SvXMLElementExport aElemStyleTabProps(*this, XML_NAMESPACE_STYLE, XML_TABLE_PROPERTIES, sal_True, sal_True);
}
}
+ if (getExportFlags() & EXPORT_MASTERSTYLES)
+ {
+ GetPageExport()->collectAutoStyles(sal_True);
+ GetPageExport()->exportAutoStyles();
+ }
+
+ // #i30251#; only write Text Styles once
+
+ if ((getExportFlags() & EXPORT_CONTENT) || (getExportFlags() & EXPORT_MASTERSTYLES))
+ GetTextParagraphExport()->exportTextAutoStyles();
}
void ScXMLExport::_ExportMasterStyles()