summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmltbli.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/xml/xmltbli.cxx')
-rw-r--r--sw/source/filter/xml/xmltbli.cxx137
1 files changed, 0 insertions, 137 deletions
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 22be0dad5587..39b9fabe39c3 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1180,143 +1180,6 @@ SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow,
SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
- const Reference< xml::sax::XAttributeList > & xAttrList ) :
- XMLTextTableContext( rImport ),
- m_pRows( new SwXMLTableRows_Impl ),
- m_pTableNode( nullptr ),
- m_pBox1( nullptr ),
- m_bOwnsBox1( false ),
- m_pSttNd1( nullptr ),
- m_pBoxFormat( nullptr ),
- m_pLineFormat( nullptr ),
- m_bFirstSection( true ),
- m_bRelWidth( true ),
- m_bHasSubTables( false ),
- m_nHeaderRows( 0 ),
- m_nCurRow( 0 ),
- m_nCurCol( 0 ),
- m_nWidth( 0 )
-{
- OUString aName;
- OUString sXmlId;
-
- // this method will modify the document directly -> lock SolarMutex
- SolarMutexGuard aGuard;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
-
- OUString aLocalName;
- const sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
- if( XML_NAMESPACE_TABLE == nPrefix )
- {
- if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- m_aStyleName = rValue;
- else if( IsXMLToken( aLocalName, XML_NAME ) )
- aName = rValue;
- else if( IsXMLToken( aLocalName, XML_DEFAULT_CELL_STYLE_NAME ) )
- m_aDfltCellStyleName = rValue;
- else if( IsXMLToken( aLocalName, XML_TEMPLATE_NAME ) )
- m_aTemplateName = rValue;
- }
- else if ( (XML_NAMESPACE_XML == nPrefix) &&
- IsXMLToken( aLocalName, XML_ID ) )
- {
- sXmlId = rValue;
- }
- }
-
- SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
-
- OUString sTableName;
- if( !aName.isEmpty() )
- {
- const SwTableFormat *pTableFormat = pDoc->FindTableFormatByName( aName );
- if( !pTableFormat )
- sTableName = aName;
- }
- if( sTableName.isEmpty() )
- {
- sTableName = pDoc->GetUniqueTableName();
- GetImport().GetTextImport()
- ->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_TABLE, aName, sTableName );
- }
-
- Reference< XTextTable > xTable;
- SwXTextTable *pXTable = nullptr;
- Reference<XMultiServiceFactory> xFactory( GetImport().GetModel(),
- UNO_QUERY );
- OSL_ENSURE( xFactory.is(), "factory missing" );
- if( xFactory.is() )
- {
- Reference<XInterface> xIfc = xFactory->createInstance( "com.sun.star.text.TextTable" );
- OSL_ENSURE( xIfc.is(), "Couldn't create a table" );
-
- if( xIfc.is() )
- xTable.set( xIfc, UNO_QUERY );
- }
-
- if( xTable.is() )
- {
- xTable->initialize( 1, 1 );
-
- try
- {
- m_xTextContent = xTable;
- GetImport().GetTextImport()->InsertTextContent( m_xTextContent );
- }
- catch( IllegalArgumentException& )
- {
- xTable = nullptr;
- }
- }
-
- if( xTable.is() )
- {
- //FIXME
- // xml:id for RDF metadata
- GetImport().SetXmlId(xTable, sXmlId);
-
- Reference<XUnoTunnel> xTableTunnel( xTable, UNO_QUERY);
- if( xTableTunnel.is() )
- {
- pXTable = reinterpret_cast< SwXTextTable * >(
- sal::static_int_cast< sal_IntPtr >( xTableTunnel->getSomething( SwXTextTable::getUnoTunnelId() )));
- OSL_ENSURE( pXTable, "SwXTextTable missing" );
- }
-
- Reference < XCellRange > xCellRange( xTable, UNO_QUERY );
- Reference < XCell > xCell = xCellRange->getCellByPosition( 0, 0 );
- Reference < XText> xText( xCell, UNO_QUERY );
- m_xOldCursor = GetImport().GetTextImport()->GetCursor();
- GetImport().GetTextImport()->SetCursor( xText->createTextCursor() );
-
- // take care of open redlines for tables
- GetImport().GetTextImport()->RedlineAdjustStartNodeCursor();
- }
- if( !pXTable )
- return;
-
- SwFrameFormat *const pTableFrameFormat = pXTable->GetFrameFormat();
- OSL_ENSURE( pTableFrameFormat, "table format missing" );
- SwTable *pTable = SwTable::FindTable( pTableFrameFormat );
- OSL_ENSURE( pTable, "table missing" );
- m_pTableNode = pTable->GetTableNode();
- OSL_ENSURE( m_pTableNode, "table node missing" );
-
- pTableFrameFormat->SetName( sTableName );
-
- SwTableLine *pLine1 = m_pTableNode->GetTable().GetTabLines()[0U];
- m_pBox1 = pLine1->GetTabBoxes()[0U];
- m_pSttNd1 = m_pBox1->GetSttNd();
-}
-
-SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
const Reference< xml::sax::XFastAttributeList > & xAttrList ) :
XMLTextTableContext( rImport ),
m_pRows( new SwXMLTableRows_Impl ),