diff options
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r-- | sw/source/filter/xml/XMLRedlineImportHelper.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/swxml.cxx | 42 | ||||
-rw-r--r-- | sw/source/filter/xml/wrtxml.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexp.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexp.hxx | 26 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 32 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlfmt.cxx | 34 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlfmte.cxx | 36 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 92 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/xml/xmliteme.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlmeta.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 260 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltbli.cxx | 238 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltbli.hxx | 18 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 126 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.hxx | 4 |
20 files changed, 497 insertions, 497 deletions
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 5534068aeb3d..b864bf936379 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -172,7 +172,7 @@ XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos, SwDoc & rDoc) { rPos.nNode = *pIndex; rPos.nNode++; // pIndex points to previous index !!! - rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(), 0 ); + rPos.nContent.Assign( rPos.nNode.GetNode().GetContentNode(), 0 ); } } @@ -467,7 +467,7 @@ Reference<XTextCursor> XMLRedlineImportHelper::CreateRedlineTextSection( } // create text section for redline - SwTxtFmtColl *pColl = pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool + SwTextFormatColl *pColl = pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool (RES_POOLCOLL_STANDARD, false ); SwStartNode* pRedlineNode = pDoc->GetNodes().MakeTextSection( pDoc->GetNodes().GetEndOfRedlines(), diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index bcdb63b16d0c..db7c647115ab 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -85,18 +85,18 @@ using namespace ::com::sun::star::lang; static void lcl_EnsureValidPam( SwPaM& rPam ) { - if( rPam.GetCntntNode() != NULL ) + if( rPam.GetContentNode() != NULL ) { // set proper point content - if( rPam.GetCntntNode() != rPam.GetPoint()->nContent.GetIdxReg() ) + if( rPam.GetContentNode() != rPam.GetPoint()->nContent.GetIdxReg() ) { - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 ); } // else: point was already valid // if mark is invalid, we delete it - if( ( rPam.GetCntntNode( false ) == NULL ) || - ( rPam.GetCntntNode( false ) != rPam.GetMark()->nContent.GetIdxReg() ) ) + if( ( rPam.GetContentNode( false ) == NULL ) || + ( rPam.GetContentNode( false ) != rPam.GetMark()->nContent.GetIdxReg() ) ) { rPam.DeleteMark(); } @@ -108,7 +108,7 @@ static void lcl_EnsureValidPam( SwPaM& rPam ) rPam.GetPoint()->nNode = *rPam.GetDoc()->GetNodes().GetEndOfContent().StartOfSectionNode(); ++ rPam.GetPoint()->nNode; - rPam.Move( fnMoveForward, fnGoCntnt ); // go into content + rPam.Move( fnMoveForward, fnGoContent ); // go into content } } @@ -392,7 +392,7 @@ static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc) // array indicating, which outline level already has a style assigned. bool aOutlineLevelAssigned[ MAXLEVEL ]; // array of the default outline styles, which are created for the document. - SwTxtFmtColl* aCreatedDefaultOutlineStyles[ MAXLEVEL ]; + SwTextFormatColl* aCreatedDefaultOutlineStyles[ MAXLEVEL ]; { for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i ) @@ -404,10 +404,10 @@ static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc) // determine, which outline level has already a style assigned and // which of the default outline styles is created. - const SwTxtFmtColls& rColls = *(_rDoc.GetTxtFmtColls()); + const SwTextFormatColls& rColls = *(_rDoc.GetTextFormatColls()); for ( size_t n = 1; n < rColls.size(); ++n ) { - SwTxtFmtColl* pColl = rColls[ n ]; + SwTextFormatColl* pColl = rColls[ n ]; if ( pColl->IsAssignedToListLevelOfOutlineStyle() ) { aOutlineLevelAssigned[ pColl->GetAssignedOutlineStyleLevel() ] = true; @@ -441,11 +441,11 @@ static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc) // apply outline numbering rule, if none is set. const SfxPoolItem& rItem = - aCreatedDefaultOutlineStyles[ i ]->GetFmtAttr( RES_PARATR_NUMRULE, false ); + aCreatedDefaultOutlineStyles[ i ]->GetFormatAttr( RES_PARATR_NUMRULE, false ); if ( static_cast<const SwNumRuleItem&>(rItem).GetValue().isEmpty() ) { SwNumRuleItem aItem( pOutlineRule->GetName() ); - aCreatedDefaultOutlineStyles[ i ]->SetFmtAttr( aItem ); + aCreatedDefaultOutlineStyles[ i ]->SetFormatAttr( aItem ); } } } @@ -687,23 +687,23 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c *pArgs++ <<= xStatusIndicator; // prepare for special modes - if( aOpt.IsFmtsOnly() ) + if( aOpt.IsFormatsOnly() ) { sal_Int32 nCount = - (aOpt.IsFrmFmts() ? 1 : 0) + + (aOpt.IsFrameFormats() ? 1 : 0) + (aOpt.IsPageDescs() ? 1 : 0) + - (aOpt.IsTxtFmts() ? 2 : 0) + + (aOpt.IsTextFormats() ? 2 : 0) + (aOpt.IsNumRules() ? 1 : 0); Sequence< OUString> aFamiliesSeq( nCount ); OUString *pSeq = aFamiliesSeq.getArray(); - if( aOpt.IsFrmFmts() ) + if( aOpt.IsFrameFormats() ) // SFX_STYLE_FAMILY_FRAME; *pSeq++ = "FrameStyles"; if( aOpt.IsPageDescs() ) // SFX_STYLE_FAMILY_PAGE; *pSeq++ = "PageStyles"; - if( aOpt.IsTxtFmts() ) + if( aOpt.IsTextFormats() ) { // (SFX_STYLE_FAMILY_CHAR|SFX_STYLE_FAMILY_PARA); *pSeq++ = "CharacterStyles"; @@ -803,7 +803,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c } sal_uInt32 nWarnRDF = 0; - if ( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFmtsOnly() || + if ( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFormatsOnly() || bInsertMode) ) { // RDF metadata - must be read before styles/content @@ -847,7 +847,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c aEmptyArgs, rName, false ); sal_uInt32 nWarn2 = 0; - if( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFmtsOnly() || + if( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFormatsOnly() || bInsertMode) ) { nWarn2 = ReadThroughComponent( @@ -863,7 +863,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c : "com.sun.star.comp.Writer.XMLStylesImporter"), aFilterArgs, rName, true ); - if( !nRet && !(IsOrganizerMode() || aOpt.IsFmtsOnly()) ) + if( !nRet && !(IsOrganizerMode() || aOpt.IsFormatsOnly()) ) nRet = ReadThroughComponent( xStorage, xModelComp, "content.xml", "Content.xml", xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentImporter" @@ -871,7 +871,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c aFilterArgs, rName, true ); if( !(IsOrganizerMode() || IsBlockMode() || bInsertMode || - aOpt.IsFmtsOnly() ) ) + aOpt.IsFormatsOnly() ) ) { try { @@ -894,7 +894,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c nRet = nRet ? nRet : (nWarn ? nWarn : (nWarn2 ? nWarn2 : nWarnRDF ) ); - aOpt.ResetAllFmtsOnly(); + aOpt.ResetAllFormatsOnly(); // redline password Any aAny = xInfoSet->getPropertyValue( sRedlineProtectionKey ); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 6e6edcad8ece..91f336ce970b 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -253,7 +253,7 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >& if( !xModelComp.is() ) return ERR_SWG_WRITE_ERROR; - PutNumFmtFontsInAttrPool(); + PutNumFormatFontsInAttrPool(); PutEditEngFontsInAttrPool(); // properties diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 6841331b23f8..f167e98fda25 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -220,9 +220,9 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) // The styles in pDoc also count the default style that never // gets exported -> subtract one. sal_Int32 nRef = 1; // meta.xml - nRef += pDoc->GetCharFmts()->size() - 1; - nRef += pDoc->GetFrmFmts()->size() - 1; - nRef += pDoc->GetTxtFmtColls()->size() - 1; + nRef += pDoc->GetCharFormats()->size() - 1; + nRef += pDoc->GetFrameFormats()->size() - 1; + nRef += pDoc->GetTextFormatColls()->size() - 1; nRef *= 2; // for the above styles, xmloff will increment by 2! // #i93174#: count all paragraphs for the progress bar nRef += pDoc->getIDocumentStatistics().GetUpdatedDocStat( false, true ).nAllPara; // 1: only content, no autostyle diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx index a16aeca00f32..108d00b1bcfa 100644 --- a/sw/source/filter/xml/xmlexp.hxx +++ b/sw/source/filter/xml/xmlexp.hxx @@ -26,8 +26,8 @@ #include <vector> class SwDoc; -class SwFmt; -class SwFrmFmt; +class SwFormat; +class SwFrameFormat; class SvXMLUnitConverter; class SvXMLExportItemMapper; class SvXMLAutoStylePoolP; @@ -37,7 +37,7 @@ class SwTableBox; class SwXMLTableColumn_Impl; class SwXMLTableLines_Impl; class SwXMLTableColumnsSortByWidth_Impl; -class SwXMLTableFrmFmtsSort_Impl; +class SwXMLTableFrameFormatsSort_Impl; class SwXMLTableInfo_Impl; class SwTableNode; class XMLPropertySetMapper; @@ -69,22 +69,22 @@ class SwXMLExport : public SvXMLExport sal_uInt32 nBaseWidth, const OUString& rNamePrefix, SwXMLTableColumnsSortByWidth_Impl& rExpCols, - SwXMLTableFrmFmtsSort_Impl& rExpRows, - SwXMLTableFrmFmtsSort_Impl& rExpCells, - SwXMLTableInfo_Impl& rTblInfo, + SwXMLTableFrameFormatsSort_Impl& rExpRows, + SwXMLTableFrameFormatsSort_Impl& rExpCells, + SwXMLTableInfo_Impl& rTableInfo, bool bTop=false ); - void ExportFmt( const SwFmt& rFmt, enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ); - void ExportTableFmt( const SwFrmFmt& rFmt, sal_uInt32 nAbsWidth ); + void ExportFormat( const SwFormat& rFormat, enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ); + void ExportTableFormat( const SwFrameFormat& rFormat, sal_uInt32 nAbsWidth ); void ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol ); void ExportTableBox( const SwTableBox& rBox, sal_uInt32 nColSpan, sal_uInt32 nRowSpan, - SwXMLTableInfo_Impl& rTblInfo ); + SwXMLTableInfo_Impl& rTableInfo ); void ExportTableLine( const SwTableLine& rLine, const SwXMLTableLines_Impl& rLines, - SwXMLTableInfo_Impl& rTblInfo ); + SwXMLTableInfo_Impl& rTableInfo ); void ExportTableLines( const SwTableLines& rLines, - SwXMLTableInfo_Impl& rTblInfo, + SwXMLTableInfo_Impl& rTableInfo, sal_uInt32 nHeaderRows = 0 ); virtual void _ExportMeta() SAL_OVERRIDE; @@ -125,8 +125,8 @@ public: inline const SvXMLUnitConverter& GetTwipUnitConverter() const; - void ExportTableAutoStyles( const SwTableNode& rTblNd ); - void ExportTable( const SwTableNode& rTblNd ); + void ExportTableAutoStyles( const SwTableNode& rTableNd ); + void ExportTable( const SwTableNode& rTableNd ); SvXMLExportItemMapper& GetTableItemMapper() { return *pTableItemMapper; } const rtl::Reference < XMLPropertySetMapper >& GetParaPropMapper() diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index f842d5a75992..af971b8e412b 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -117,7 +117,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, { if( 0 != (rEntry.nMemberId & MID_SW_FLAG_SPECIAL_ITEM_EXPORT) ) { - if( rItem.ISA( SwFmtRowSplit ) ) + if( rItem.ISA( SwFormatRowSplit ) ) { OUString aValue; bool bAddAttribute = true; @@ -429,15 +429,15 @@ bool SvXMLExportItemMapper::QueryXMLValue( case MID_FIRST_LINE_INDENT: if( !pLRSpace->IsAutoFirst() ) { - if(pLRSpace->GetPropTxtFirstLineOfst() != 100) + if(pLRSpace->GetPropTextFirstLineOfst() != 100) { ::sax::Converter::convertPercent( - aOut, pLRSpace->GetPropTxtFirstLineOfst() ); + aOut, pLRSpace->GetPropTextFirstLineOfst() ); } else { rUnitConverter.convertMeasureToXML( - aOut, pLRSpace->GetTxtFirstLineOfst() ); + aOut, pLRSpace->GetTextFirstLineOfst() ); } } else @@ -827,15 +827,15 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_BREAK: { - const SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem); - OSL_ENSURE( pFmtBreak != NULL, "Wrong Which-ID" ); + const SvxFormatBreakItem* pFormatBreak = PTR_CAST(SvxFormatBreakItem, &rItem); + OSL_ENSURE( pFormatBreak != NULL, "Wrong Which-ID" ); unsigned int eEnum = 0; switch( nMemberId ) { case MID_BREAK_BEFORE: - switch( pFmtBreak->GetValue() ) + switch( pFormatBreak->GetValue() ) { case SVX_BREAK_COLUMN_BEFORE: eEnum = 1; @@ -851,7 +851,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( } break; case MID_BREAK_AFTER: - switch( pFmtBreak->GetValue() ) + switch( pFormatBreak->GetValue() ) { case SVX_BREAK_COLUMN_AFTER: eEnum = 1; @@ -874,11 +874,11 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_KEEP: { - const SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem); - assert(pFmtKeep && "Wrong Which-ID"); - if (pFmtKeep) + const SvxFormatKeepItem* pFormatKeep = PTR_CAST(SvxFormatKeepItem, &rItem); + assert(pFormatKeep && "Wrong Which-ID"); + if (pFormatKeep) { - aOut.append( pFmtKeep->GetValue() + aOut.append( pFormatKeep->GetValue() ? GetXMLToken( XML_ALWAYS ) : GetXMLToken( XML_AUTO ) ); bOk = true; @@ -1002,7 +1002,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_PAGEDESC: { - const SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem); + const SwFormatPageDesc* pPageDesc = PTR_CAST(SwFormatPageDesc, &rItem); OSL_ENSURE( pPageDesc != NULL, "Wrong Which-ID" ); if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId ) @@ -1038,7 +1038,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_HORI_ORIENT: { - const SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem); + const SwFormatHoriOrient* pHoriOrient = PTR_CAST(SwFormatHoriOrient, &rItem); assert(pHoriOrient && "Wrong Which-ID"); if (pHoriOrient) { @@ -1051,7 +1051,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_VERT_ORIENT: { - const SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem); + const SwFormatVertOrient* pVertOrient = PTR_CAST(SwFormatVertOrient, &rItem); assert(pVertOrient && "Wrong Which-ID"); SvXMLUnitConverter::convertEnum( aOut, pVertOrient->GetVertOrient(), @@ -1062,7 +1062,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_FRM_SIZE: { - const SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem); + const SwFormatFrmSize* pFrmSize = PTR_CAST(SwFormatFrmSize, &rItem); OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" ); bool bOutHeight = false; diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index b4f243b13657..f9281cf8117b 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -386,7 +386,7 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) const SwDoc *pDoc = pStyle->GetDoc(); - SwTxtFmtColl *pColl = pDoc->FindTxtFmtCollByName( pStyle->GetStyleName() ); + SwTextFormatColl *pColl = pDoc->FindTextFormatCollByName( pStyle->GetStyleName() ); OSL_ENSURE( pColl, "Text collection not found" ); if( !pColl || RES_CONDTXTFMTCOLL != pColl->Which() ) return; @@ -403,14 +403,14 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) sName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true); - SwTxtFmtColl* pCondColl = pDoc->FindTxtFmtCollByName( sName ); + SwTextFormatColl* pCondColl = pDoc->FindTextFormatCollByName( sName ); OSL_ENSURE( pCondColl, "SwXMLItemSetStyleContext_Impl::ConnectConditions: cond coll missing" ); if( pCondColl ) { SwCollCondition aCond( pCondColl, pCond->GetCondition(), pCond->GetSubCondition() ); - static_cast<SwConditionTxtFmtColl*>(pColl)->InsertCondition( aCond ); + static_cast<SwConditionTextFormatColl*>(pColl)->InsertCondition( aCond ); } } } @@ -653,21 +653,21 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc() } const SfxPoolItem *pItem; - SwFmtPageDesc *pFmtPageDesc = 0; + SwFormatPageDesc *pFormatPageDesc = 0; if( SfxItemState::SET == pItemSet->GetItemState( RES_PAGEDESC, false, &pItem ) ) { - if( static_cast<const SwFmtPageDesc *>(pItem)->GetPageDesc() != pPageDesc ) - pFmtPageDesc = new SwFmtPageDesc( *static_cast<const SwFmtPageDesc *>(pItem) ); + if( static_cast<const SwFormatPageDesc *>(pItem)->GetPageDesc() != pPageDesc ) + pFormatPageDesc = new SwFormatPageDesc( *static_cast<const SwFormatPageDesc *>(pItem) ); } else - pFmtPageDesc = new SwFmtPageDesc(); + pFormatPageDesc = new SwFormatPageDesc(); - if( pFmtPageDesc ) + if( pFormatPageDesc ) { - pFmtPageDesc->RegisterToPageDesc( *pPageDesc ); - pItemSet->Put( *pFmtPageDesc ); - delete pFmtPageDesc; + pFormatPageDesc->RegisterToPageDesc( *pPageDesc ); + pItemSet->Put( *pFormatPageDesc ); + delete pFormatPageDesc; } } @@ -690,7 +690,7 @@ bool SwXMLItemSetStyleContext_Impl::ResolveDataStyleName() SfxItemPool& rItemPool = pDoc->GetAttrPool(); pItemSet = new SfxItemSet( rItemPool, aTableBoxSetRange ); } - SwTblBoxNumFormat aNumFormatItem(nFormat); + SwTableBoxNumFormat aNumFormatItem(nFormat); pItemSet->Put(aNumFormatItem); } @@ -998,20 +998,20 @@ void SwXMLImport::FinishStyles() GetStyles()->FinishStyles( !IsInsertMode() ); } -void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc ) +void SwXMLImport::UpdateTextCollConditions( SwDoc *pDoc ) { if( !pDoc ) pDoc = SwImport::GetDocFromXMLImport( *this ); - const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls(); + const SwTextFormatColls& rColls = *pDoc->GetTextFormatColls(); const size_t nCount = rColls.size(); for( size_t i=0; i < nCount; ++i ) { - SwTxtFmtColl *pColl = rColls[i]; + SwTextFormatColl *pColl = rColls[i]; if( pColl && RES_CONDTXTFMTCOLL == pColl->Which() ) { - const SwFmtCollConditions& rConditions = - static_cast<const SwConditionTxtFmtColl *>(pColl)->GetCondColls(); + const SwFormatCollConditions& rConditions = + static_cast<const SwConditionTextFormatColl *>(pColl)->GetCondColls(); bool bSendModify = false; for( size_t j=0; j < rConditions.size() && !bSendModify; ++j ) { diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index ec0594b0f402..b966c22a4d2a 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -46,48 +46,48 @@ using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::lang; using namespace ::xmloff::token; -void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) +void SwXMLExport::ExportFormat( const SwFormat& rFormat, enum XMLTokenEnum eFamily ) { // <style:style ...> CheckAttrList(); // style:family="..." - OSL_ENSURE( RES_FRMFMT==rFmt.Which(), "frame format expected" ); - if( RES_FRMFMT != rFmt.Which() ) + OSL_ENSURE( RES_FRMFMT==rFormat.Which(), "frame format expected" ); + if( RES_FRMFMT != rFormat.Which() ) return; OSL_ENSURE( eFamily != XML_TOKEN_INVALID, "family must be specified" ); // style:name="..." bool bEncoded = false; AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, EncodeStyleName( - rFmt.GetName(), &bEncoded ) ); + rFormat.GetName(), &bEncoded ) ); if( bEncoded ) - AddAttribute( XML_NAMESPACE_STYLE, XML_DISPLAY_NAME, rFmt.GetName() ); + AddAttribute( XML_NAMESPACE_STYLE, XML_DISPLAY_NAME, rFormat.GetName() ); if( eFamily != XML_TOKEN_INVALID ) AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, eFamily ); #if OSL_DEBUG_LEVEL > 0 // style:parent-style-name="..." (if its not the default only) - const SwFmt* pParent = rFmt.DerivedFrom(); + const SwFormat* pParent = rFormat.DerivedFrom(); // Parent-Namen nur uebernehmen, wenn kein Default OSL_ENSURE( !pParent || pParent->IsDefault(), "unexpected parent" ); - OSL_ENSURE( USHRT_MAX == rFmt.GetPoolFmtId(), "pool ids arent'supported" ); - OSL_ENSURE( USHRT_MAX == rFmt.GetPoolHelpId(), "help ids arent'supported" ); - OSL_ENSURE( USHRT_MAX == rFmt.GetPoolHelpId() || - UCHAR_MAX == rFmt.GetPoolHlpFileId(), "help file ids aren't supported" ); + OSL_ENSURE( USHRT_MAX == rFormat.GetPoolFormatId(), "pool ids arent'supported" ); + OSL_ENSURE( USHRT_MAX == rFormat.GetPoolHelpId(), "help ids arent'supported" ); + OSL_ENSURE( USHRT_MAX == rFormat.GetPoolHelpId() || + UCHAR_MAX == rFormat.GetPoolHlpFileId(), "help file ids aren't supported" ); #endif // style:master-page-name - if( RES_FRMFMT == rFmt.Which() && XML_TABLE == eFamily ) + if( RES_FRMFMT == rFormat.Which() && XML_TABLE == eFamily ) { const SfxPoolItem *pItem; - if( SfxItemState::SET == rFmt.GetAttrSet().GetItemState( RES_PAGEDESC, + if( SfxItemState::SET == rFormat.GetAttrSet().GetItemState( RES_PAGEDESC, false, &pItem ) ) { OUString sName; const SwPageDesc *pPageDesc = - static_cast<const SwFmtPageDesc *>(pItem)->GetPageDesc(); + static_cast<const SwFormatPageDesc *>(pItem)->GetPageDesc(); if( pPageDesc ) SwStyleNameMapper::FillProgName( pPageDesc->GetName(), @@ -101,15 +101,15 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) if( XML_TABLE_CELL == eFamily ) { - OSL_ENSURE(RES_FRMFMT == rFmt.Which(), "only frame format"); + OSL_ENSURE(RES_FRMFMT == rFormat.Which(), "only frame format"); const SfxPoolItem *pItem; if( SfxItemState::SET == - rFmt.GetAttrSet().GetItemState( RES_BOXATR_FORMAT, + rFormat.GetAttrSet().GetItemState( RES_BOXATR_FORMAT, false, &pItem ) ) { sal_Int32 nFormat = (sal_Int32) - static_cast<const SwTblBoxNumFormat *>(pItem)->GetValue(); + static_cast<const SwTableBoxNumFormat *>(pItem)->GetValue(); if ( (nFormat != -1) && (nFormat != css::util::NumberFormat::TEXT) ) { @@ -152,7 +152,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) rItemMapper.setMapEntries( xItemMap ); GetTableItemMapper().exportXML( *this, - rFmt.GetAttrSet(), + rFormat.GetAttrSet(), GetTwipUnitConverter(), ePropToken, SvXmlExportFlags::IGN_WS ); @@ -228,7 +228,7 @@ void SwXMLExport::_ExportAutoStyles() GetPageExport()->exportAutoStyles(); // we rely on data styles being written after cell styles in the - // ExportFmt() method; so be careful when changing order. + // ExportFormat() method; so be careful when changing order. exportAutoDataStyles(); SvXMLExportFlags nContentAutostyles = SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES; diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 08ab57c90ebb..a9d264554f8d 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -492,10 +492,10 @@ static OTextCursorHelper *lcl_xml_GetSwXTextCursor( const Reference < XTextCurso OSL_ENSURE( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" ); if( !xCrsrTunnel.is() ) return 0; - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper *>( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper *>( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); - return pTxtCrsr; + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); + return pTextCrsr; } void SwXMLImport::startDocument() @@ -596,7 +596,7 @@ void SwXMLImport::startDocument() // We also might change into the insert mode later, so we have to make // sure to first set the insert mode and then create the text import // helper. Otherwise it won't have the insert flag set! - OTextCursorHelper *pTxtCrsr = 0; + OTextCursorHelper *pTextCrsr = 0; Reference < XTextCursor > xTextCursor; if( HasTextImport() ) xTextCursor = GetTextImport()->GetCursor(); @@ -609,12 +609,12 @@ void SwXMLImport::startDocument() SwDoc *pDoc = 0; if( SvXMLImportFlags::ALL == getImportFlags() ) { - pTxtCrsr = lcl_xml_GetSwXTextCursor( xTextCursor ); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); - if( !pTxtCrsr ) + pTextCrsr = lcl_xml_GetSwXTextCursor( xTextCursor ); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); + if( !pTextCrsr ) return; - pDoc = pTxtCrsr->GetDoc(); + pDoc = pTextCrsr->GetDoc(); OSL_ENSURE( pDoc, "SwDoc missing" ); if( !pDoc ) return; @@ -632,7 +632,7 @@ void SwXMLImport::startDocument() *pDoc, *pCrsrSh->GetCrsr()->GetPoint(), 0 ) ); setTextInsertMode( xInsertTextRange ); xTextCursor = GetTextImport()->GetCursor(); - pTxtCrsr = 0; + pTextCrsr = 0; } else GetTextImport()->SetCursor( xTextCursor ); @@ -641,13 +641,13 @@ void SwXMLImport::startDocument() if( (!(getImportFlags() & (SvXMLImportFlags::CONTENT|SvXMLImportFlags::MASTERSTYLES)))) return; - if( !pTxtCrsr ) - pTxtCrsr = lcl_xml_GetSwXTextCursor( xTextCursor ); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); - if( !pTxtCrsr ) + if( !pTextCrsr ) + pTextCrsr = lcl_xml_GetSwXTextCursor( xTextCursor ); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); + if( !pTextCrsr ) return; - SwDoc *pDoc = pTxtCrsr->GetDoc(); + SwDoc *pDoc = pTextCrsr->GetDoc(); OSL_ENSURE( pDoc, "SwDoc missing" ); if( !pDoc ) return; @@ -657,7 +657,7 @@ void SwXMLImport::startDocument() pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() ); if( IsInsertMode() ) { - SwPaM *pPaM = pTxtCrsr->GetPaM(); + SwPaM *pPaM = pTextCrsr->GetPaM(); const SwPosition* pPos = pPaM->GetPoint(); // Split once and remember the node that has been splitted. @@ -669,8 +669,8 @@ void SwXMLImport::startDocument() // Insert all content into the new node pPaM->Move( fnMoveBackward ); - pDoc->SetTxtFmtColl - ( *pPaM, pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, false ) ); + pDoc->SetTextFormatColl + ( *pPaM, pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD, false ) ); } } @@ -729,18 +729,18 @@ void SwXMLImport::endDocument() Reference<XUnoTunnel> xCrsrTunnel( GetTextImport()->GetCursor(), UNO_QUERY); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper *>( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper *>( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - assert(pTxtCrsr && "SwXTextCursor missing"); - SwPaM *pPaM = pTxtCrsr->GetPaM(); + assert(pTextCrsr && "SwXTextCursor missing"); + SwPaM *pPaM = pTextCrsr->GetPaM(); if( IsInsertMode() && pSttNdIdx->GetIndex() ) { // If we are in insert mode, join the splitted node that is in front // of the new content with the first new node. Or in other words: // Revert the first split node. - SwTxtNode* pTxtNode = pSttNdIdx->GetNode().GetTxtNode(); + SwTextNode* pTextNode = pSttNdIdx->GetNode().GetTextNode(); SwNodeIndex aNxtIdx( *pSttNdIdx ); - if( pTxtNode && pTxtNode->CanJoinNext( &aNxtIdx ) && + if( pTextNode && pTextNode->CanJoinNext( &aNxtIdx ) && pSttNdIdx->GetIndex() + 1 == aNxtIdx.GetIndex() ) { // If the PaM points to the first new node, move the PaM to the @@ -748,8 +748,8 @@ void SwXMLImport::endDocument() if( pPaM->GetPoint()->nNode == aNxtIdx ) { pPaM->GetPoint()->nNode = *pSttNdIdx; - pPaM->GetPoint()->nContent.Assign( pTxtNode, - pTxtNode->GetTxt().getLength()); + pPaM->GetPoint()->nContent.Assign( pTextNode, + pTextNode->GetText().getLength()); } #if OSL_DEBUG_LEVEL > 0 @@ -766,27 +766,27 @@ void SwXMLImport::endDocument() { const sal_Int32 nCntPos = pPaM->GetBound( true ).nContent.GetIndex(); - pPaM->GetBound( true ).nContent.Assign( pTxtNode, - pTxtNode->GetTxt().getLength() + nCntPos ); + pPaM->GetBound( true ).nContent.Assign( pTextNode, + pTextNode->GetText().getLength() + nCntPos ); } if( pSttNdIdx->GetIndex()+1 == pPaM->GetBound( false ).nNode.GetIndex() ) { const sal_Int32 nCntPos = pPaM->GetBound( false ).nContent.GetIndex(); - pPaM->GetBound( false ).nContent.Assign( pTxtNode, - pTxtNode->GetTxt().getLength() + nCntPos ); + pPaM->GetBound( false ).nContent.Assign( pTextNode, + pTextNode->GetText().getLength() + nCntPos ); } #endif // If the first new node isn't empty, convert the node's text // attributes into hints. Otherwise, set the new node's // paragraph style at the previous (empty) node. - SwTxtNode* pDelNd = aNxtIdx.GetNode().GetTxtNode(); - if (!pTxtNode->GetTxt().isEmpty()) - pDelNd->FmtToTxtAttr( pTxtNode ); + SwTextNode* pDelNd = aNxtIdx.GetNode().GetTextNode(); + if (!pTextNode->GetText().isEmpty()) + pDelNd->FormatToTextAttr( pTextNode ); else - pTxtNode->ChgFmtColl( pDelNd->GetTxtColl() ); - pTxtNode->JoinNext(); + pTextNode->ChgFormatColl( pDelNd->GetTextColl() ); + pTextNode->JoinNext(); } } @@ -794,21 +794,21 @@ void SwXMLImport::endDocument() OSL_ENSURE( !pPos->nContent.GetIndex(), "last paragraph isn't empty" ); if( !pPos->nContent.GetIndex() ) { - SwTxtNode* pCurrNd; + SwTextNode* pCurrNd; sal_uLong nNodeIdx = pPos->nNode.GetIndex(); pDoc = pPaM->GetDoc(); - OSL_ENSURE( pPos->nNode.GetNode().IsCntntNode(), + OSL_ENSURE( pPos->nNode.GetNode().IsContentNode(), "insert position is not a content node" ); if( !IsInsertMode() ) { // If we're not in insert mode, the last node is deleted. const SwNode *pPrev = pDoc->GetNodes()[nNodeIdx -1]; - if( pPrev->IsCntntNode() || + if( pPrev->IsContentNode() || ( pPrev->IsEndNode() && pPrev->StartOfSectionNode()->IsSectionNode() ) ) { - SwCntntNode* pCNd = pPaM->GetCntntNode(); + SwContentNode* pCNd = pPaM->GetContentNode(); if( pCNd && pCNd->StartOfSectionIndex()+2 < pCNd->EndOfSectionIndex() ) { @@ -818,13 +818,13 @@ void SwXMLImport::endDocument() } } } - else if( 0 != (pCurrNd = pDoc->GetNodes()[nNodeIdx]->GetTxtNode()) ) + else if( 0 != (pCurrNd = pDoc->GetNodes()[nNodeIdx]->GetTextNode()) ) { // Id we're in insert mode, the empty node is joined with // the next and the previous one. if( pCurrNd->CanJoinNext( &pPos->nNode )) { - SwTxtNode* pNextNd = pPos->nNode.GetNode().GetTxtNode(); + SwTextNode* pNextNd = pPos->nNode.GetNode().GetTextNode(); pPos->nContent.Assign( pNextNd, 0 ); pPaM->SetMark(); pPaM->DeleteMark(); pNextNd->JoinPrev(); @@ -837,7 +837,7 @@ void SwXMLImport::endDocument() pNextNd->JoinPrev(); } } - else if (pCurrNd->GetTxt().isEmpty()) + else if (pCurrNd->GetText().isEmpty()) { pPos->nContent.Assign( 0, 0 ); pPaM->SetMark(); pPaM->DeleteMark(); @@ -855,9 +855,9 @@ void SwXMLImport::endDocument() if( (getImportFlags() & SvXMLImportFlags::CONTENT) || ((getImportFlags() & SvXMLImportFlags::MASTERSTYLES) && IsStylesOnlyMode()) ) { - // pDoc might be 0. In this case UpdateTxtCollCondition is looking + // pDoc might be 0. In this case UpdateTextCollCondition is looking // for it itself. - UpdateTxtCollConditions( pDoc ); + UpdateTextCollConditions( pDoc ); } GetTextImport()->ResetCursor(); @@ -1503,11 +1503,11 @@ void SwXMLImport::initialize( SwDoc* SwImport::GetDocFromXMLImport( SvXMLImport& rImport ) { uno::Reference<lang::XUnoTunnel> xModelTunnel( rImport.GetModel(), uno::UNO_QUERY ); - SwXTextDocument *pTxtDoc = reinterpret_cast< SwXTextDocument *>( + SwXTextDocument *pTextDoc = reinterpret_cast< SwXTextDocument *>( sal::static_int_cast< sal_IntPtr >( xModelTunnel->getSomething(SwXTextDocument::getUnoTunnelId() ))); - assert( pTxtDoc ); - assert( pTxtDoc->GetDocShell() ); - SwDoc* pDoc = pTxtDoc->GetDocShell()->GetDoc(); + assert( pTextDoc ); + assert( pTextDoc->GetDocShell() ); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); OSL_ENSURE( pDoc, "Where is my document?" ); return pDoc; } diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index e6006f12b6d3..7fae001383c5 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -83,7 +83,7 @@ class SwXMLImport: public SvXMLImport void _InitItemImport(); void _FinitItemImport(); - void UpdateTxtCollConditions( SwDoc *pDoc ); + void UpdateTextCollConditions( SwDoc *pDoc ); void setTextInsertMode( const ::com::sun::star::uno::Reference< diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 7bd9541f659a..7774d194de86 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -283,7 +283,7 @@ bool SvXMLImportItemMapper::PutXMLValue( switch( nMemberId ) { case MID_L_MARGIN: - pLRSpace->SetTxtLeft( (sal_Int32)nAbs, (sal_uInt16)nProp ); + pLRSpace->SetTextLeft( (sal_Int32)nAbs, (sal_uInt16)nProp ); break; case MID_R_MARGIN: pLRSpace->SetRight( (sal_Int32)nAbs, (sal_uInt16)nProp ); @@ -304,7 +304,7 @@ bool SvXMLImportItemMapper::PutXMLValue( bOk = rUnitConverter.convertMeasureToCore(nAbs, rValue, -0x7fff, 0x7fff ); - pLRSpace->SetTxtFirstLineOfst( (short)nAbs, (sal_uInt16)nProp ); + pLRSpace->SetTextFirstLineOfst( (short)nAbs, (sal_uInt16)nProp ); } break; @@ -589,8 +589,8 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_BREAK: { - SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem); - OSL_ENSURE( pFmtBreak != NULL, "Wrong Which-ID" ); + SvxFormatBreakItem* pFormatBreak = PTR_CAST(SvxFormatBreakItem, &rItem); + OSL_ENSURE( pFormatBreak != NULL, "Wrong Which-ID" ); sal_uInt16 eEnum; @@ -599,7 +599,7 @@ bool SvXMLImportItemMapper::PutXMLValue( if( eEnum == 0 ) { - pFmtBreak->SetValue( SVX_BREAK_NONE ); + pFormatBreak->SetValue( SVX_BREAK_NONE ); bOk = true; } else @@ -607,12 +607,12 @@ bool SvXMLImportItemMapper::PutXMLValue( switch( nMemberId ) { case MID_BREAK_BEFORE: - pFmtBreak->SetValue( static_cast< sal_uInt16 >((eEnum == 1) ? + pFormatBreak->SetValue( static_cast< sal_uInt16 >((eEnum == 1) ? SVX_BREAK_COLUMN_BEFORE : SVX_BREAK_PAGE_BEFORE) ); break; case MID_BREAK_AFTER: - pFmtBreak->SetValue( static_cast< sal_uInt16 >((eEnum == 1) ? + pFormatBreak->SetValue( static_cast< sal_uInt16 >((eEnum == 1) ? SVX_BREAK_COLUMN_AFTER : SVX_BREAK_PAGE_AFTER) ); break; @@ -624,19 +624,19 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_KEEP: { - SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem); - OSL_ENSURE( pFmtKeep != NULL, "Wrong Which-ID" ); + SvxFormatKeepItem* pFormatKeep = PTR_CAST(SvxFormatKeepItem, &rItem); + OSL_ENSURE( pFormatKeep != NULL, "Wrong Which-ID" ); if( IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_TRUE ) ) { - pFmtKeep->SetValue( true ); + pFormatKeep->SetValue( true ); bOk = true; } else if( IsXMLToken( rValue, XML_AUTO ) || IsXMLToken( rValue, XML_FALSE ) ) { - pFmtKeep->SetValue( false ); + pFormatKeep->SetValue( false ); bOk = true; } } @@ -787,7 +787,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_PAGEDESC: { - SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem); + SwFormatPageDesc* pPageDesc = PTR_CAST(SwFormatPageDesc, &rItem); OSL_ENSURE( pPageDesc != NULL, "Wrong Which-ID" ); if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId ) @@ -824,7 +824,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_HORI_ORIENT: { - SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem); + SwFormatHoriOrient* pHoriOrient = PTR_CAST(SwFormatHoriOrient, &rItem); OSL_ENSURE( pHoriOrient != NULL, "Wrong Which-ID" ); sal_uInt16 nValue; @@ -837,7 +837,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_VERT_ORIENT: { - SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem); + SwFormatVertOrient* pVertOrient = PTR_CAST(SwFormatVertOrient, &rItem); OSL_ENSURE( pVertOrient != NULL, "Wrong Which-ID" ); sal_uInt16 nValue; @@ -856,7 +856,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_FRM_SIZE: { - SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem); + SwFormatFrmSize* pFrmSize = PTR_CAST(SwFormatFrmSize, &rItem); OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" ); bool bSetHeight = false; diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx index 614ba83ea162..536dc949e43e 100644 --- a/sw/source/filter/xml/xmliteme.cxx +++ b/sw/source/filter/xml/xmliteme.cxx @@ -130,7 +130,7 @@ void SwXMLTableItemMapper_Impl::handleSpecialItem( &pItem ) ) { sal_Int16 eHoriOrient = - static_cast<const SwFmtHoriOrient *>(pItem)->GetHoriOrient(); + static_cast<const SwFormatHoriOrient *>(pItem)->GetHoriOrient(); bool bExport = false; sal_uInt16 nMemberId = static_cast<sal_uInt16>( rEntry.nMemberId & MID_SW_FLAG_MASK ); @@ -232,11 +232,11 @@ void SwXMLExport::_FinitItemExport() delete pTwipUnitConv; } -void SwXMLExport::ExportTableFmt( const SwFrmFmt& rFmt, sal_uInt32 nAbsWidth ) +void SwXMLExport::ExportTableFormat( const SwFrameFormat& rFormat, sal_uInt32 nAbsWidth ) { static_cast<SwXMLTableItemMapper_Impl *>(pTableItemMapper) ->SetAbsWidth( nAbsWidth ); - ExportFmt( rFmt, XML_TABLE ); + ExportFormat( rFormat, XML_TABLE ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index ef4d17cf5010..9a201702688f 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -94,7 +94,7 @@ struct statistic { }; static const struct statistic s_stats [] = { - { XML_TOK_META_STAT_TABLE, "TableCount", &SwDocStat::nTbl, 0 }, + { XML_TOK_META_STAT_TABLE, "TableCount", &SwDocStat::nTable, 0 }, { XML_TOK_META_STAT_IMAGE, "ImageCount", &SwDocStat::nGrf, 0 }, { XML_TOK_META_STAT_OLE, "ObjectCount", &SwDocStat::nOLE, 0 }, { XML_TOK_META_STAT_PAGE, "PageCount", 0, &SwDocStat::nPage }, diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 0716e6154571..d9dd57abe32d 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -175,33 +175,33 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : } } -typedef vector< SwFrmFmt* > SwXMLFrmFmts_Impl; +typedef vector< SwFrameFormat* > SwXMLFrameFormats_Impl; -class SwXMLTableFrmFmtsSort_Impl +class SwXMLTableFrameFormatsSort_Impl { private: - SwXMLFrmFmts_Impl aFormatList; + SwXMLFrameFormats_Impl aFormatList; public: - bool AddRow( SwFrmFmt& rFrmFmt, const OUString& rNamePrefix, sal_uInt32 nLine ); - bool AddCell( SwFrmFmt& rFrmFmt, const OUString& rNamePrefix, + bool AddRow( SwFrameFormat& rFrameFormat, const OUString& rNamePrefix, sal_uInt32 nLine ); + bool AddCell( SwFrameFormat& rFrameFormat, const OUString& rNamePrefix, sal_uInt32 nCol, sal_uInt32 nRow, bool bTop ); }; -bool SwXMLTableFrmFmtsSort_Impl::AddRow( SwFrmFmt& rFrmFmt, +bool SwXMLTableFrameFormatsSort_Impl::AddRow( SwFrameFormat& rFrameFormat, const OUString& rNamePrefix, sal_uInt32 nLine ) { - const SwFmtFrmSize *pFrmSize = 0; - const SwFmtRowSplit* pRowSplit = 0; + const SwFormatFrmSize *pFrmSize = 0; + const SwFormatRowSplit* pRowSplit = 0; const SvxBrushItem *pBrush = 0; - const SfxItemSet& rItemSet = rFrmFmt.GetAttrSet(); + const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); const SfxPoolItem *pItem; if( SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, false, &pItem ) ) - pFrmSize = static_cast<const SwFmtFrmSize *>(pItem); + pFrmSize = static_cast<const SwFormatFrmSize *>(pItem); if( SfxItemState::SET == rItemSet.GetItemState( RES_ROW_SPLIT, false, &pItem ) ) - pRowSplit = static_cast<const SwFmtRowSplit *>(pItem); + pRowSplit = static_cast<const SwFormatRowSplit *>(pItem); if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) pBrush = static_cast<const SvxBrushItem *>(pItem); @@ -212,21 +212,21 @@ bool SwXMLTableFrmFmtsSort_Impl::AddRow( SwFrmFmt& rFrmFmt, // order is: -/brush, size/-, size/brush bool bInsert = true; - SwXMLFrmFmts_Impl::iterator i; + SwXMLFrameFormats_Impl::iterator i; for( i = aFormatList.begin(); i < aFormatList.end(); ++i ) { - const SwFmtFrmSize *pTestFrmSize = 0; - const SwFmtRowSplit* pTestRowSplit = 0; + const SwFormatFrmSize *pTestFrmSize = 0; + const SwFormatRowSplit* pTestRowSplit = 0; const SvxBrushItem *pTestBrush = 0; - const SwFrmFmt *pTestFmt = *i; - const SfxItemSet& rTestSet = pTestFmt->GetAttrSet(); + const SwFrameFormat *pTestFormat = *i; + const SfxItemSet& rTestSet = pTestFormat->GetAttrSet(); if( SfxItemState::SET == rTestSet.GetItemState( RES_FRM_SIZE, false, &pItem ) ) { if( !pFrmSize ) break; - pTestFrmSize = static_cast<const SwFmtFrmSize *>(pItem); + pTestFrmSize = static_cast<const SwFormatFrmSize *>(pItem); } else { @@ -254,7 +254,7 @@ bool SwXMLTableFrmFmtsSort_Impl::AddRow( SwFrmFmt& rFrmFmt, if( !pRowSplit ) break; - pTestRowSplit = static_cast<const SwFmtRowSplit *>(pItem); + pTestRowSplit = static_cast<const SwFormatRowSplit *>(pItem); } else { @@ -274,16 +274,16 @@ bool SwXMLTableFrmFmtsSort_Impl::AddRow( SwFrmFmt& rFrmFmt, continue; // found! - rFrmFmt.SetName( pTestFmt->GetName() ); + rFrameFormat.SetName( pTestFormat->GetName() ); bInsert = false; break; } if( bInsert ) { - rFrmFmt.SetName( rNamePrefix + "." + OUString::number(nLine+1UL) ); + rFrameFormat.SetName( rNamePrefix + "." + OUString::number(nLine+1UL) ); if ( i != aFormatList.end() ) ++i; - aFormatList.insert( i, &rFrmFmt ); + aFormatList.insert( i, &rFrameFormat ); } return bInsert; @@ -295,7 +295,7 @@ static OUString lcl_xmltble_appendBoxPrefix(const OUString& rNamePrefix, if( bTop ) { OUString sTmp; - sw_GetTblBoxColStr( (sal_uInt16)nCol, sTmp ); + sw_GetTableBoxColStr( (sal_uInt16)nCol, sTmp ); return rNamePrefix + "." + sTmp + OUString::number(nRow + 1); } return rNamePrefix @@ -303,21 +303,21 @@ static OUString lcl_xmltble_appendBoxPrefix(const OUString& rNamePrefix, + "." + OUString::number(nRow + 1); } -bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt, +bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, const OUString& rNamePrefix, sal_uInt32 nCol, sal_uInt32 nRow, bool bTop ) { - const SwFmtVertOrient *pVertOrient = 0; + const SwFormatVertOrient *pVertOrient = 0; const SvxBrushItem *pBrush = 0; const SvxBoxItem *pBox = 0; - const SwTblBoxNumFormat *pNumFmt = 0; + const SwTableBoxNumFormat *pNumFormat = 0; const SvxFrameDirectionItem *pFrameDir = 0; - const SfxItemSet& rItemSet = rFrmFmt.GetAttrSet(); + const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); const SfxPoolItem *pItem; if( SfxItemState::SET == rItemSet.GetItemState( RES_VERT_ORIENT, false, &pItem ) ) - pVertOrient = static_cast<const SwFmtVertOrient *>(pItem); + pVertOrient = static_cast<const SwFormatVertOrient *>(pItem); if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) pBrush = static_cast<const SvxBrushItem *>(pItem); @@ -327,13 +327,13 @@ bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt, if ( SfxItemState::SET == rItemSet.GetItemState( RES_BOXATR_FORMAT, false, &pItem ) ) - pNumFmt = static_cast<const SwTblBoxNumFormat *>(pItem); + pNumFormat = static_cast<const SwTableBoxNumFormat *>(pItem); if ( SfxItemState::SET == rItemSet.GetItemState( RES_FRAMEDIR, false, &pItem ) ) pFrameDir = static_cast<const SvxFrameDirectionItem *>(pItem); // empty styles have not to be exported - if( !pVertOrient && !pBrush && !pBox && !pNumFmt && !pFrameDir ) + if( !pVertOrient && !pBrush && !pBox && !pNumFormat && !pFrameDir ) return false; // order is: -/-/-/num, @@ -343,23 +343,23 @@ bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt, // vert/brush/-/-, vert/brush/-/num, vert/brush/box/-, // vert/brush/box/num bool bInsert = true; - SwXMLFrmFmts_Impl::iterator i; + SwXMLFrameFormats_Impl::iterator i; for( i = aFormatList.begin(); i < aFormatList.end(); ++i ) { - const SwFmtVertOrient *pTestVertOrient = 0; + const SwFormatVertOrient *pTestVertOrient = 0; const SvxBrushItem *pTestBrush = 0; const SvxBoxItem *pTestBox = 0; - const SwTblBoxNumFormat *pTestNumFmt = 0; + const SwTableBoxNumFormat *pTestNumFormat = 0; const SvxFrameDirectionItem *pTestFrameDir = 0; - const SwFrmFmt* pTestFmt = *i; - const SfxItemSet& rTestSet = pTestFmt->GetAttrSet(); + const SwFrameFormat* pTestFormat = *i; + const SfxItemSet& rTestSet = pTestFormat->GetAttrSet(); if( SfxItemState::SET == rTestSet.GetItemState( RES_VERT_ORIENT, false, &pItem ) ) { if( !pVertOrient ) break; - pTestVertOrient = static_cast<const SwFmtVertOrient *>(pItem); + pTestVertOrient = static_cast<const SwFormatVertOrient *>(pItem); } else { @@ -397,14 +397,14 @@ bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt, if ( SfxItemState::SET == rTestSet.GetItemState( RES_BOXATR_FORMAT, false, &pItem ) ) { - if( !pNumFmt ) + if( !pNumFormat ) break; - pTestNumFmt = static_cast<const SwTblBoxNumFormat *>(pItem); + pTestNumFormat = static_cast<const SwTableBoxNumFormat *>(pItem); } else { - if( pNumFmt ) + if( pNumFormat ) continue; } @@ -434,23 +434,23 @@ bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt, if( pBox && ( *pBox != *pTestBox ) ) continue; - if( pNumFmt && pNumFmt->GetValue() != pTestNumFmt->GetValue() ) + if( pNumFormat && pNumFormat->GetValue() != pTestNumFormat->GetValue() ) continue; if( pFrameDir && pFrameDir->GetValue() != pTestFrameDir->GetValue() ) continue; // found! - rFrmFmt.SetName( pTestFmt->GetName() ); + rFrameFormat.SetName( pTestFormat->GetName() ); bInsert = false; break; } if( bInsert ) { - rFrmFmt.SetName( lcl_xmltble_appendBoxPrefix( rNamePrefix, nCol, nRow, bTop ) ); + rFrameFormat.SetName( lcl_xmltble_appendBoxPrefix( rNamePrefix, nCol, nRow, bTop ) ); if ( i != aFormatList.end() ) ++i; - aFormatList.insert( i, &rFrmFmt ); + aFormatList.insert( i, &rFrameFormat ); } return bInsert; @@ -465,10 +465,10 @@ class SwXMLTableInfo_Impl public: - inline SwXMLTableInfo_Impl( const SwTable *pTbl, sal_uInt16 nPrefix ); + inline SwXMLTableInfo_Impl( const SwTable *pTable, sal_uInt16 nPrefix ); const SwTable *GetTable() const { return m_pTable; } - const SwFrmFmt *GetTblFmt() const { return m_pTable->GetFrmFmt(); } + const SwFrameFormat *GetTableFormat() const { return m_pTable->GetFrameFormat(); } bool IsBaseSectionValid() const { return m_bBaseSectionValid; } const Reference<XTextSection>& GetBaseSection() const { return m_xBaseSection; } @@ -537,9 +537,9 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, sal_uInt32 nAbsWidth, sal_uInt32 nBaseWidth, const OUString& rNamePrefix, SwXMLTableColumnsSortByWidth_Impl& rExpCols, - SwXMLTableFrmFmtsSort_Impl& rExpRows, - SwXMLTableFrmFmtsSort_Impl& rExpCells, - SwXMLTableInfo_Impl& rTblInfo, + SwXMLTableFrameFormatsSort_Impl& rExpRows, + SwXMLTableFrameFormatsSort_Impl& rExpCells, + SwXMLTableInfo_Impl& rTableInfo, bool bTop ) { // pass 1: calculate columns @@ -597,7 +597,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, if( bTop ) { OUString sTmp; - sw_GetTblBoxColStr( nColumn, sTmp ); + sw_GetTableBoxColStr( nColumn, sTmp ); pColumn->SetStyleName( rNamePrefix + "." + sTmp ); } else @@ -616,9 +616,9 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, { SwTableLine *pLine = rLines[nLine]; - SwFrmFmt *pFrmFmt = pLine->GetFrmFmt(); - if( rExpRows.AddRow( *pFrmFmt, rNamePrefix, nLine ) ) - ExportFmt( *pFrmFmt, XML_TABLE_ROW ); + SwFrameFormat *pFrameFormat = pLine->GetFrameFormat(); + if( rExpRows.AddRow( *pFrameFormat, rNamePrefix, nLine ) ) + ExportFormat( *pFrameFormat, XML_TABLE_ROW ); const SwTableBoxes& rBoxes = pLine->GetTabBoxes(); const size_t nBoxes = rBoxes.size(); @@ -644,26 +644,26 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, const SwStartNode *pBoxSttNd = pBox->GetSttNd(); if( pBoxSttNd ) { - SwFrmFmt *pFrmFmt2 = pBox->GetFrmFmt(); - if( rExpCells.AddCell( *pFrmFmt2, rNamePrefix, nOldCol, nLine, + SwFrameFormat *pFrameFormat2 = pBox->GetFrameFormat(); + if( rExpCells.AddCell( *pFrameFormat2, rNamePrefix, nOldCol, nLine, bTop) ) - ExportFmt( *pFrmFmt2, XML_TABLE_CELL ); + ExportFormat( *pFrameFormat2, XML_TABLE_CELL ); Reference < XCell > xCell = SwXCell::CreateXCell( - const_cast<SwFrmFmt *>(rTblInfo.GetTblFmt()), + const_cast<SwFrameFormat *>(rTableInfo.GetTableFormat()), pBox, - const_cast<SwTable *>(rTblInfo.GetTable()) ); + const_cast<SwTable *>(rTableInfo.GetTable()) ); if (xCell.is()) { Reference < XText > xText( xCell, UNO_QUERY ); - if( !rTblInfo.IsBaseSectionValid() ) + if( !rTableInfo.IsBaseSectionValid() ) { Reference<XPropertySet> xCellPropertySet( xCell, UNO_QUERY ); Any aAny = xCellPropertySet->getPropertyValue("TextSection"); Reference < XTextSection > xTextSection; aAny >>= xTextSection; - rTblInfo.SetBaseSection( xTextSection ); + rTableInfo.SetBaseSection( xTextSection ); } const bool bExportContent = bool(getExportFlags() & SvXMLExportFlags::CONTENT ); @@ -671,7 +671,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, { // AUTOSTYLES - not needed anymore if we are currently exporting content.xml GetTextParagraphExport()->collectTextAutoStyles( - xText, rTblInfo.GetBaseSection(), IsShowProgress() ); + xText, rTableInfo.GetBaseSection(), IsShowProgress() ); } } else { @@ -685,7 +685,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, lcl_xmltble_appendBoxPrefix( rNamePrefix, nOldCol, nLine, bTop ), rExpCols, rExpRows, rExpCells, - rTblInfo ); + rTableInfo ); } nCol++; @@ -693,15 +693,15 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, } } -void SwXMLExport::ExportTableAutoStyles( const SwTableNode& rTblNd ) +void SwXMLExport::ExportTableAutoStyles( const SwTableNode& rTableNd ) { - const SwTable& rTbl = rTblNd.GetTable(); - const SwFrmFmt *pTblFmt = rTbl.GetFrmFmt(); + const SwTable& rTable = rTableNd.GetTable(); + const SwFrameFormat *pTableFormat = rTable.GetFrameFormat(); - if( pTblFmt ) + if( pTableFormat ) { - sal_Int16 eTabHoriOri = pTblFmt->GetHoriOrient().GetHoriOrient(); - const SwFmtFrmSize& rFrmSize = pTblFmt->GetFrmSize(); + sal_Int16 eTabHoriOri = pTableFormat->GetHoriOrient().GetHoriOrient(); + const SwFormatFrmSize& rFrmSize = pTableFormat->GetFrmSize(); sal_uInt32 nAbsWidth = rFrmSize.GetSize().Width(); sal_uInt32 nBaseWidth = 0UL; @@ -712,36 +712,36 @@ void SwXMLExport::ExportTableAutoStyles( const SwTableNode& rTblNd ) if( bFixAbsWidth ) { nBaseWidth = nAbsWidth; - nAbsWidth = pTblFmt->FindLayoutRect(true).Width(); + nAbsWidth = pTableFormat->FindLayoutRect(true).Width(); if( !nAbsWidth ) { // TODO? } } - ExportTableFmt( *pTblFmt, nAbsWidth ); + ExportTableFormat( *pTableFormat, nAbsWidth ); SwXMLTableColumnsSortByWidth_Impl aExpCols; - SwXMLTableFrmFmtsSort_Impl aExpRows; - SwXMLTableFrmFmtsSort_Impl aExpCells; - SwXMLTableInfo_Impl aTblInfo( &rTbl, XML_NAMESPACE_TABLE ); - ExportTableLinesAutoStyles( rTbl.GetTabLines(), nAbsWidth, nBaseWidth, - pTblFmt->GetName(), aExpCols, aExpRows, aExpCells, - aTblInfo, true); + SwXMLTableFrameFormatsSort_Impl aExpRows; + SwXMLTableFrameFormatsSort_Impl aExpCells; + SwXMLTableInfo_Impl aTableInfo( &rTable, XML_NAMESPACE_TABLE ); + ExportTableLinesAutoStyles( rTable.GetTabLines(), nAbsWidth, nBaseWidth, + pTableFormat->GetName(), aExpCols, aExpRows, aExpCells, + aTableInfo, true); } } void SwXMLExport::ExportTableBox( const SwTableBox& rBox, sal_uInt32 nColSpan, sal_uInt32 nRowSpan, - SwXMLTableInfo_Impl& rTblInfo ) + SwXMLTableInfo_Impl& rTableInfo ) { const SwStartNode *pBoxSttNd = rBox.GetSttNd(); if( pBoxSttNd ) { - const SwFrmFmt *pFrmFmt = rBox.GetFrmFmt(); - if( pFrmFmt ) + const SwFrameFormat *pFrameFormat = rBox.GetFrameFormat(); + if( pFrameFormat ) { - const OUString sName = pFrmFmt->GetName(); + const OUString sName = pFrameFormat->GetName(); if( !sName.isEmpty() ) { AddAttribute( XML_NAMESPACE_TABLE, XML_STYLE_NAME, EncodeStyleName(sName) ); @@ -766,9 +766,9 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, { // start node -> normal cell // get cell range for table - Reference<XCell> xCell = SwXCell::CreateXCell( const_cast<SwFrmFmt *>(rTblInfo.GetTblFmt()), + Reference<XCell> xCell = SwXCell::CreateXCell( const_cast<SwFrameFormat *>(rTableInfo.GetTableFormat()), const_cast<SwTableBox *>(&rBox), - const_cast<SwTable *>(rTblInfo.GetTable()) ); + const_cast<SwTable *>(rTableInfo.GetTable()) ); if (xCell.is()) { @@ -822,22 +822,22 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, XML_TRUE ); } - if( !rTblInfo.IsBaseSectionValid() ) + if( !rTableInfo.IsBaseSectionValid() ) { aAny = xCellPropertySet->getPropertyValue("TextSection"); Reference < XTextSection > xTextSection; aAny >>= xTextSection; - rTblInfo.SetBaseSection( xTextSection ); + rTableInfo.SetBaseSection( xTextSection ); } } // export cell element - SvXMLElementExport aElem( *this, rTblInfo.GetPrefix(), + SvXMLElementExport aElem( *this, rTableInfo.GetPrefix(), XML_TABLE_CELL, true, true ); // export cell content GetTextParagraphExport()->exportText( xText, - rTblInfo.GetBaseSection(), + rTableInfo.GetBaseSection(), IsShowProgress() ); } else @@ -857,7 +857,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, SvXMLElementExport aElemExport( *this, XML_NAMESPACE_TABLE, XML_TABLE, true, true ); - ExportTableLines( rBox.GetTabLines(), rTblInfo ); + ExportTableLines( rBox.GetTabLines(), rTableInfo ); } } } @@ -865,17 +865,17 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, void SwXMLExport::ExportTableLine( const SwTableLine& rLine, const SwXMLTableLines_Impl& rLines, - SwXMLTableInfo_Impl& rTblInfo ) + SwXMLTableInfo_Impl& rTableInfo ) { if( rLine.hasSoftPageBreak() ) { SvXMLElementExport aElem( *this, XML_NAMESPACE_TEXT, XML_SOFT_PAGE_BREAK, true, true ); } - const SwFrmFmt *pFrmFmt = rLine.GetFrmFmt(); - if( pFrmFmt ) + const SwFrameFormat *pFrameFormat = rLine.GetFrameFormat(); + if( pFrameFormat ) { - const OUString sName = pFrmFmt->GetName(); + const OUString sName = pFrameFormat->GetName(); if( !sName.isEmpty() ) { AddAttribute( XML_NAMESPACE_TABLE, XML_STYLE_NAME, EncodeStyleName(sName) ); @@ -883,7 +883,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, } { - SvXMLElementExport aElem( *this, rTblInfo.GetPrefix(), XML_TABLE_ROW, true, true ); + SvXMLElementExport aElem( *this, rTableInfo.GetPrefix(), XML_TABLE_ROW, true, true ); const SwTableBoxes& rBoxes = rLine.GetTabBoxes(); const size_t nBoxes = rBoxes.size(); @@ -897,7 +897,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, const long nRowSpan = pBox->getRowSpan(); if( nRowSpan < 1 ) { - SvXMLElementExport aElem2( *this, rTblInfo.GetPrefix(), + SvXMLElementExport aElem2( *this, rTableInfo.GetPrefix(), XML_COVERED_TABLE_CELL, true, false ); } @@ -926,11 +926,11 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, const sal_uInt32 nColSpan = nCol - nOldCol + 1U; if ( nRowSpan >= 1 ) - ExportTableBox( *pBox, nColSpan, static_cast< sal_uInt32 >(nRowSpan), rTblInfo ); + ExportTableBox( *pBox, nColSpan, static_cast< sal_uInt32 >(nRowSpan), rTableInfo ); for( size_t i=nOldCol; i<nCol; ++i ) { - SvXMLElementExport aElemExport( *this, rTblInfo.GetPrefix(), + SvXMLElementExport aElemExport( *this, rTableInfo.GetPrefix(), XML_COVERED_TABLE_CELL, true, false ); } @@ -941,7 +941,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, } void SwXMLExport::ExportTableLines( const SwTableLines& rLines, - SwXMLTableInfo_Impl& rTblInfo, + SwXMLTableInfo_Impl& rTableInfo, sal_uInt32 nHeaderRows ) { OSL_ENSURE( pTableLines && !pTableLines->empty(), @@ -1004,7 +1004,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, } { - SvXMLElementExport aElem( *this, rTblInfo.GetPrefix(), XML_TABLE_COLUMN, true, true ); + SvXMLElementExport aElem( *this, rTableInfo.GetPrefix(), XML_TABLE_COLUMN, true, true ); } nColRep = 1; @@ -1022,12 +1022,12 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, OSL_ENSURE( nHeaderRows <= nLines, "more headers then lines?" ); for( size_t nLine = 0U; nLine < nHeaderRows; ++nLine ) - ExportTableLine( *(rLines[nLine]), *pLines, rTblInfo ); + ExportTableLine( *(rLines[nLine]), *pLines, rTableInfo ); } // export remaining rows for( size_t nLine = nHeaderRows; nLine < nLines; ++nLine ) { - ExportTableLine( *(rLines[nLine]), *pLines, rTblInfo ); + ExportTableLine( *(rLines[nLine]), *pLines, rTableInfo ); } delete pLines; @@ -1044,9 +1044,9 @@ static void lcl_xmltble_ClearName_Box( SwTableBox* pBox ) } else { - SwFrmFmt *pFrmFmt = pBox->GetFrmFmt(); - if( pFrmFmt && !pFrmFmt->GetName().isEmpty() ) - pFrmFmt->SetName( OUString() ); + SwFrameFormat *pFrameFormat = pBox->GetFrameFormat(); + if( pFrameFormat && !pFrameFormat->GetName().isEmpty() ) + pFrameFormat->SetName( OUString() ); } } @@ -1056,21 +1056,21 @@ void lcl_xmltble_ClearName_Line( SwTableLine* pLine ) lcl_xmltble_ClearName_Box( pBox ); } -void SwXMLExport::ExportTable( const SwTableNode& rTblNd ) +void SwXMLExport::ExportTable( const SwTableNode& rTableNd ) { - const SwTable& rTbl = rTblNd.GetTable(); - const SwFrmFmt *pTblFmt = rTbl.GetFrmFmt(); - if( pTblFmt && !pTblFmt->GetName().isEmpty() ) + const SwTable& rTable = rTableNd.GetTable(); + const SwFrameFormat *pTableFormat = rTable.GetFrameFormat(); + if( pTableFormat && !pTableFormat->GetName().isEmpty() ) { - AddAttribute( XML_NAMESPACE_TABLE, XML_NAME, pTblFmt->GetName() ); + AddAttribute( XML_NAMESPACE_TABLE, XML_NAME, pTableFormat->GetName() ); AddAttribute( XML_NAMESPACE_TABLE, XML_STYLE_NAME, - EncodeStyleName( pTblFmt->GetName() ) ); + EncodeStyleName( pTableFormat->GetName() ) ); } sal_uInt16 nPrefix = XML_NAMESPACE_TABLE; - if (const SwFrmFmt* pFlyFormat = rTblNd.GetFlyFmt()) + if (const SwFrameFormat* pFlyFormat = rTableNd.GetFlyFormat()) { - std::set<const SwFrmFmt*> aTextBoxes = SwTextBoxHelper::findTextBoxes(rTblNd.GetDoc()); + std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(rTableNd.GetDoc()); if (aTextBoxes.find(pFlyFormat) != aTextBoxes.end()) nPrefix = XML_NAMESPACE_LO_EXT; } @@ -1079,18 +1079,18 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd ) SvXMLElementExport aElem( *this, nPrefix, XML_TABLE, true, true ); // export DDE source (if this is a DDE table) - if ( rTbl.ISA(SwDDETable) ) + if ( rTable.ISA(SwDDETable) ) { // get DDE Field Type (contains the DDE connection) - const SwDDEFieldType* pDDEFldType = - static_cast<const SwDDETable&>(rTbl).GetDDEFldType(); + const SwDDEFieldType* pDDEFieldType = + static_cast<const SwDDETable&>(rTable).GetDDEFieldType(); // connection name AddAttribute( XML_NAMESPACE_OFFICE, XML_NAME, - pDDEFldType->GetName() ); + pDDEFieldType->GetName() ); // DDE command - const OUString sCmd = pDDEFldType->GetCmd(); + const OUString sCmd = pDDEFieldType->GetCmd(); AddAttribute( XML_NAMESPACE_OFFICE, XML_DDE_APPLICATION, sCmd.getToken(0, sfx2::cTokenSeparator) ); AddAttribute( XML_NAMESPACE_OFFICE, XML_DDE_ITEM, @@ -1099,7 +1099,7 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd ) sCmd.getToken(2, sfx2::cTokenSeparator) ); // auto update - if (pDDEFldType->GetType() == SfxLinkUpdateMode::ALWAYS) + if (pDDEFieldType->GetType() == SfxLinkUpdateMode::ALWAYS) { AddAttribute( XML_NAMESPACE_OFFICE, XML_AUTOMATIC_UPDATE, XML_TRUE ); @@ -1110,10 +1110,10 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd ) XML_DDE_SOURCE, true, false); } - SwXMLTableInfo_Impl aTblInfo( &rTbl, nPrefix ); - ExportTableLines( rTbl.GetTabLines(), aTblInfo, rTbl.GetRowsToRepeat() ); + SwXMLTableInfo_Impl aTableInfo( &rTable, nPrefix ); + ExportTableLines( rTable.GetTabLines(), aTableInfo, rTable.GetRowsToRepeat() ); - for( SwTableLine *pLine : ((SwTable &)rTbl).GetTabLines() ) + for( SwTableLine *pLine : ((SwTable &)rTable).GetTabLines() ) lcl_xmltble_ClearName_Line( pLine ); } } @@ -1125,9 +1125,9 @@ void SwXMLTextParagraphExport::exportTable( bool bOldShowProgress = static_cast<SwXMLExport&>(GetExport()).IsShowProgress(); static_cast<SwXMLExport&>(GetExport()).SetShowProgress( _bProgress ); - Reference < XTextTable > xTxtTbl( rTextContent, UNO_QUERY ); - OSL_ENSURE( xTxtTbl.is(), "text table missing" ); - if( xTxtTbl.is() ) + Reference < XTextTable > xTextTable( rTextContent, UNO_QUERY ); + OSL_ENSURE( xTextTable.is(), "text table missing" ); + if( xTextTable.is() ) { const SwXTextTable *pXTable = 0; Reference<XUnoTunnel> xTableTunnel( rTextContent, UNO_QUERY); @@ -1139,27 +1139,27 @@ void SwXMLTextParagraphExport::exportTable( } if( pXTable ) { - SwFrmFmt *pFmt = pXTable->GetFrmFmt(); - OSL_ENSURE( pFmt, "table format missing" ); - const SwTable *pTbl = SwTable::FindTable( pFmt ); - OSL_ENSURE( pTbl, "table missing" ); - const SwTableNode *pTblNd = pTbl->GetTableNode(); - OSL_ENSURE( pTblNd, "table node missing" ); + SwFrameFormat *pFormat = pXTable->GetFrameFormat(); + OSL_ENSURE( pFormat, "table format missing" ); + const SwTable *pTable = SwTable::FindTable( pFormat ); + OSL_ENSURE( pTable, "table missing" ); + const SwTableNode *pTableNd = pTable->GetTableNode(); + OSL_ENSURE( pTableNd, "table node missing" ); if( bAutoStyles ) { - SwNodeIndex aIdx( *pTblNd ); + SwNodeIndex aIdx( *pTableNd ); // AUTOSTYLES: Optimization: Do not export table autostyle if // we are currently exporting the content.xml stuff and // the table is located in header/footer: // During the flat XML export (used e.g. by .sdw-export) // ALL flags are set at the same time. const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES ); - if ( bExportStyles || !pFmt->GetDoc()->IsInHeaderFooter( aIdx ) ) - static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles( *pTblNd ); + if ( bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter( aIdx ) ) + static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles( *pTableNd ); } else { - static_cast<SwXMLExport&>(GetExport()).ExportTable( *pTblNd ); + static_cast<SwXMLExport&>(GetExport()).ExportTable( *pTableNd ); } } } diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 42b9437aa075..a478cb726ee2 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -643,12 +643,12 @@ SvXMLImportContext *SwXMLTableCellContext_Impl::CreateChildContext( { if( !HasContent() ) { - SwXMLTableContext *pTblContext = + SwXMLTableContext *pTableContext = new SwXMLTableContext( GetSwImport(), nPrefix, rLocalName, xAttrList, GetTable() ); - pContext = pTblContext; + pContext = pTableContext; if( GetTable()->IsValid() ) - InsertContent( pTblContext ); + InsertContent( pTableContext ); GetTable()->SetHasSubTables( true ); } @@ -683,18 +683,18 @@ void SwXMLTableCellContext_Impl::EndElement() { // The original text is invalid after deleting the last // paragraph - Reference < XTextCursor > xSrcTxtCursor = + Reference < XTextCursor > xSrcTextCursor = GetImport().GetTextImport()->GetText()->createTextCursor(); - xSrcTxtCursor->gotoEnd( sal_True ); + xSrcTextCursor->gotoEnd( sal_True ); // Until we have an API for copying we have to use the core. - Reference<XUnoTunnel> xSrcCrsrTunnel( xSrcTxtCursor, UNO_QUERY); + Reference<XUnoTunnel> xSrcCrsrTunnel( xSrcTextCursor, UNO_QUERY); assert(xSrcCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pSrcTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pSrcTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xSrcCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - assert(pSrcTxtCrsr && "SwXTextCursor missing"); - SwDoc *pDoc = pSrcTxtCrsr->GetDoc(); - const SwPaM *pSrcPaM = pSrcTxtCrsr->GetPaM(); + assert(pSrcTextCrsr && "SwXTextCursor missing"); + SwDoc *pDoc = pSrcTextCrsr->GetDoc(); + const SwPaM *pSrcPaM = pSrcTextCrsr->GetPaM(); while( nColRepeat > 1 && GetTable()->IsInsertCellPossible() ) { @@ -703,11 +703,11 @@ void SwXMLTableCellContext_Impl::EndElement() Reference<XUnoTunnel> xDstCrsrTunnel( GetImport().GetTextImport()->GetCursor(), UNO_QUERY); assert(xDstCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pDstTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pDstTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xDstCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )) ); - assert(pDstTxtCrsr && "SwXTextCursor missing"); + assert(pDstTextCrsr && "SwXTextCursor missing"); SwPaM aSrcPaM(*pSrcPaM->GetMark(), *pSrcPaM->GetPoint()); - SwPosition aDstPos( *pDstTxtCrsr->GetPaM()->GetPoint() ); + SwPosition aDstPos( *pDstTextCrsr->GetPaM()->GetPoint() ); pDoc->getIDocumentContentOperations().CopyRange( aSrcPaM, aDstPos, /*bCopyAll=*/false, /*bCheckPos=*/true ); nColRepeat--; @@ -798,7 +798,7 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl( SfxItemState::SET == pAutoItemSet->GetItemState( RES_FRM_SIZE, false, &pItem ) ) { - const SwFmtFrmSize *pSize = static_cast<const SwFmtFrmSize *>(pItem); + const SwFormatFrmSize *pSize = static_cast<const SwFormatFrmSize *>(pItem); nWidth = pSize->GetWidth(); bRelWidth = ATT_VAR_SIZE == pSize->GetHeightSizeType(); } @@ -1144,7 +1144,7 @@ void SwXMLDDETableContext_Impl::StartElement( } // generate a new name for DDE field type (called by lcl_GetDDEFieldType below) -static OUString lcl_GenerateFldTypeName(const OUString& sPrefix, SwTableNode* pTableNode) +static OUString lcl_GenerateFieldTypeName(const OUString& sPrefix, SwTableNode* pTableNode) { const OUString sPrefixStr(sPrefix.isEmpty() ? OUString("_") : sPrefix); @@ -1160,7 +1160,7 @@ static OUString lcl_GenerateFldTypeName(const OUString& sPrefix, SwTableNode* pT ++nCount; sName = sPrefixStr + OUString::number(nCount); } - while (NULL != pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFldType(RES_DDEFLD, sName, false)); + while (NULL != pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFieldType(RES_DDEFLD, sName, false)); return sName; } @@ -1188,13 +1188,13 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, // valid name? if (sName.isEmpty()) { - sName = lcl_GenerateFldTypeName(pContext->GetDDEApplication(), + sName = lcl_GenerateFieldTypeName(pContext->GetDDEApplication(), pTableNode); } else { // check for existing DDE field type with the same name - SwDDEFieldType* pOldType = static_cast<SwDDEFieldType*>(pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFldType(RES_DDEFLD, sName, false)); + SwDDEFieldType* pOldType = static_cast<SwDDEFieldType*>(pTableNode->GetDoc()->getIDocumentFieldsAccess().GetFieldType(RES_DDEFLD, sName, false)); if (NULL != pOldType) { // same values -> return old type @@ -1207,7 +1207,7 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, else { // same name, different values -> think of new name - sName = lcl_GenerateFldTypeName(pContext->GetDDEApplication(), + sName = lcl_GenerateFieldTypeName(pContext->GetDDEApplication(), pTableNode); } } @@ -1220,7 +1220,7 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, // create new field type and return SwDDEFieldType aDDEFieldType(sName, sCommand, nType); pType = static_cast<SwDDEFieldType*>(pTableNode-> - GetDoc()->getIDocumentFieldsAccess().InsertFldType(aDDEFieldType)); + GetDoc()->getIDocumentFieldsAccess().InsertFieldType(aDDEFieldType)); } OSL_ENSURE(NULL != pType, "We really want a SwDDEFieldType here!"); @@ -1284,8 +1284,8 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, pTableNode( 0 ), pBox1( 0 ), pSttNd1( 0 ), - pBoxFmt( 0 ), - pLineFmt( 0 ), + pBoxFormat( 0 ), + pLineFormat( 0 ), pSharedBoxFormats(NULL), pDDESource(NULL), bFirstSection( true ), @@ -1330,18 +1330,18 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() ); - OUString sTblName; + OUString sTableName; if( !aName.isEmpty() ) { - const SwTableFmt *pTblFmt = pDoc->FindTblFmtByName( aName ); - if( !pTblFmt ) - sTblName = aName; + const SwTableFormat *pTableFormat = pDoc->FindTableFormatByName( aName ); + if( !pTableFormat ) + sTableName = aName; } - if( sTblName.isEmpty() ) + if( sTableName.isEmpty() ) { - sTblName = pDoc->GetUniqueTblName(); + sTableName = pDoc->GetUniqueTableName(); GetImport().GetTextImport() - ->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_TABLE, aName, sTblName ); + ->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_TABLE, aName, sTableName ); } Reference< XTextTable > xTable; @@ -1398,14 +1398,14 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, } if( pXTable ) { - SwFrmFmt *pTblFrmFmt = pXTable->GetFrmFmt(); - OSL_ENSURE( pTblFrmFmt, "table format missing" ); - SwTable *pTbl = SwTable::FindTable( pTblFrmFmt ); - OSL_ENSURE( pTbl, "table missing" ); - pTableNode = pTbl->GetTableNode(); + SwFrameFormat *pTableFrameFormat = pXTable->GetFrameFormat(); + OSL_ENSURE( pTableFrameFormat, "table format missing" ); + SwTable *pTable = SwTable::FindTable( pTableFrameFormat ); + OSL_ENSURE( pTable, "table missing" ); + pTableNode = pTable->GetTableNode(); OSL_ENSURE( pTableNode, "table node missing" ); - pTblFrmFmt->SetName( sTblName ); + pTableFrameFormat->SetName( sTableName ); SwTableLine *pLine1 = pTableNode->GetTable().GetTabLines()[0U]; pBox1 = pLine1->GetTabBoxes()[0U]; @@ -1424,8 +1424,8 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, pTableNode( pTable->pTableNode ), pBox1( 0 ), pSttNd1( 0 ), - pBoxFmt( 0 ), - pLineFmt( 0 ), + pBoxFormat( 0 ), + pLineFormat( 0 ), pSharedBoxFormats(NULL), xParentTable( pTable ), pDDESource(NULL), @@ -1844,12 +1844,12 @@ SwTableBox *SwXMLTableContext::NewTableBox( const SwStartNode *pStNd, pBox1 = 0; } else - pBox = new SwTableBox( pBoxFmt, *pStNd, pUpper ); + pBox = new SwTableBox( pBoxFormat, *pStNd, pUpper ); return pBox; } -SwTableBoxFmt* SwXMLTableContext::GetSharedBoxFormat( +SwTableBoxFormat* SwXMLTableContext::GetSharedBoxFormat( SwTableBox* pBox, const OUString& rStyleName, sal_Int32 nColumnWidth, @@ -1859,48 +1859,48 @@ SwTableBoxFmt* SwXMLTableContext::GetSharedBoxFormat( bool* pModifyLocked ) { if ( pSharedBoxFormats == NULL ) - pSharedBoxFormats = new map_BoxFmt(); + pSharedBoxFormats = new map_BoxFormat(); - SwTableBoxFmt* pBoxFmt2; + SwTableBoxFormat* pBoxFormat2; TableBoxIndex aKey( rStyleName, nColumnWidth, bProtected ); - map_BoxFmt::iterator aIter = pSharedBoxFormats->find( aKey ); + map_BoxFormat::iterator aIter = pSharedBoxFormats->find( aKey ); if ( aIter == pSharedBoxFormats->end() ) { // unknown format so far -> construct a new one // get the old format, and reset all attributes // (but preserve FillOrder) - pBoxFmt2 = static_cast<SwTableBoxFmt*>(pBox->ClaimFrmFmt()); - SwFmtFillOrder aFillOrder( pBoxFmt2->GetFillOrder() ); - pBoxFmt2->ResetAllFmtAttr(); // #i73790# - method renamed - pBoxFmt2->SetFmtAttr( aFillOrder ); + pBoxFormat2 = static_cast<SwTableBoxFormat*>(pBox->ClaimFrameFormat()); + SwFormatFillOrder aFillOrder( pBoxFormat2->GetFillOrder() ); + pBoxFormat2->ResetAllFormatAttr(); // #i73790# - method renamed + pBoxFormat2->SetFormatAttr( aFillOrder ); bNew = true; // it's a new format now // share this format, if allowed if ( bMayShare ) - (*pSharedBoxFormats)[ aKey ] = pBoxFmt2; + (*pSharedBoxFormats)[ aKey ] = pBoxFormat2; } else { // set the shared format - pBoxFmt2 = aIter->second; - pBox->ChgFrmFmt( pBoxFmt2 ); + pBoxFormat2 = aIter->second; + pBox->ChgFrameFormat( pBoxFormat2 ); bNew = false; // copied from an existing format // claim it, if we are not allowed to share if ( !bMayShare ) - pBoxFmt2 = static_cast<SwTableBoxFmt*>(pBox->ClaimFrmFmt()); + pBoxFormat2 = static_cast<SwTableBoxFormat*>(pBox->ClaimFrameFormat()); } // lock format (if so desired) if ( pModifyLocked != NULL ) { - (*pModifyLocked) = pBoxFmt2->IsModifyLocked(); - pBoxFmt2->LockModify(); + (*pModifyLocked) = pBoxFormat2->IsModifyLocked(); + pBoxFormat2->LockModify(); } - return pBoxFmt2; + return pBoxFormat2; } SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper, @@ -1910,18 +1910,18 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper, sal_uInt32 nRightCol ) { //FIXME: here would be a great place to handle XmlId for cell - SwTableBox *pBox = new SwTableBox( pBoxFmt, 0, pUpper ); + SwTableBox *pBox = new SwTableBox( pBoxFormat, 0, pUpper ); sal_uInt32 nColSpan = nRightCol - nLeftCol; sal_Int32 nColWidth = GetColumnWidth( nLeftCol, nColSpan ); // TODO: Share formats! - SwFrmFmt *pFrmFmt = pBox->ClaimFrmFmt(); - SwFmtFillOrder aFillOrder( pFrmFmt->GetFillOrder() ); - pFrmFmt->ResetAllFmtAttr(); // #i73790# - method renamed - pFrmFmt->SetFmtAttr( aFillOrder ); + SwFrameFormat *pFrameFormat = pBox->ClaimFrameFormat(); + SwFormatFillOrder aFillOrder( pFrameFormat->GetFillOrder() ); + pFrameFormat->ResetAllFormatAttr(); // #i73790# - method renamed + pFrameFormat->SetFormatAttr( aFillOrder ); - pFrmFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nColWidth ) ); + pFrameFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, nColWidth ) ); SwTableLines& rLines = pBox->GetTabLines(); bool bSplitted = false; @@ -2018,7 +2018,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( { // and it is a table: therefore we build a new box and // put the rows of the table into the rows of the box - pBox = new SwTableBox( pBoxFmt, 0, pUpper ); + pBox = new SwTableBox( pBoxFormat, 0, pUpper ); pCell->GetSubTable()->MakeTable( pBox, nColWidth ); } @@ -2026,7 +2026,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( const OUString sStyleName = pCell->GetStyleName(); bool bModifyLocked; bool bNew; - SwTableBoxFmt *pBoxFmt2 = GetSharedBoxFormat( + SwTableBoxFormat *pBoxFormat2 = GetSharedBoxFormat( pBox, sStyleName, nColWidth, pCell->IsProtected(), pCell->GetStartNode() && pCell->GetFormula().isEmpty() && ! pCell->HasValue(), @@ -2042,7 +2042,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( XML_STYLE_FAMILY_TABLE_CELL, sStyleName, &pAutoItemSet ) ) { if( pAutoItemSet ) - pBoxFmt2->SetFmtAttr( *pAutoItemSet ); + pBoxFormat2->SetFormatAttr( *pAutoItemSet ); } } @@ -2051,14 +2051,14 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if (pCell->HasStringValue()) { SwNodeIndex const aNodeIndex(*(pCell->GetStartNode()), 1); - SwTxtNode *const pTxtNode(aNodeIndex.GetNode().GetTxtNode()); - SAL_WARN_IF(!pTxtNode, "sw", "Should have a text node in cell?"); - if (pTxtNode) + SwTextNode *const pTextNode(aNodeIndex.GetNode().GetTextNode()); + SAL_WARN_IF(!pTextNode, "sw", "Should have a text node in cell?"); + if (pTextNode) { - SAL_WARN_IF(!pTxtNode->GetTxt().isEmpty(), "sw", + SAL_WARN_IF(!pTextNode->GetText().isEmpty(), "sw", "why text here?"); - pTxtNode->InsertText(*pCell->GetStringValue(), - SwIndex(pTxtNode, 0)); + pTextNode->InsertText(*pCell->GetStringValue(), + SwIndex(pTextNode, 0)); } } @@ -2076,11 +2076,11 @@ SwTableBox *SwXMLTableContext::MakeTableBox( { // default num format? const SfxPoolItem* pItem = NULL; - if( pBoxFmt2->GetItemState( RES_BOXATR_FORMAT, false, &pItem ) + if( pBoxFormat2->GetItemState( RES_BOXATR_FORMAT, false, &pItem ) == SfxItemState::SET ) { - const SwTblBoxNumFormat* pNumFormat = - static_cast<const SwTblBoxNumFormat*>( pItem ); + const SwTableBoxNumFormat* pNumFormat = + static_cast<const SwTableBoxNumFormat*>( pItem ); if( ( pNumFormat != NULL ) && ( pNumFormat->GetValue() == 0 ) ) { // only one text node? @@ -2088,11 +2088,11 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if( ( aNodeIndex.GetNode().EndOfSectionIndex() - aNodeIndex.GetNode().StartOfSectionIndex() ) == 2 ) { - SwTxtNode* pTxtNode= aNodeIndex.GetNode().GetTxtNode(); - if( pTxtNode != NULL ) + SwTextNode* pTextNode= aNodeIndex.GetNode().GetTextNode(); + if( pTextNode != NULL ) { // check text: does it look like some form of 0.0? - const OUString& rText = pTxtNode->GetTxt(); + const OUString& rText = pTextNode->GetText(); if( ( rText.getLength() > 10 ) || ( rText.indexOf( '0' ) == -1 ) ) { @@ -2109,9 +2109,9 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if( bSuppressNumericContent ) { // suppress numeric content? Then reset number format! - pBoxFmt2->ResetFmtAttr( RES_BOXATR_FORMULA ); - pBoxFmt2->ResetFmtAttr( RES_BOXATR_FORMAT ); - pBoxFmt2->ResetFmtAttr( RES_BOXATR_VALUE ); + pBoxFormat2->ResetFormatAttr( RES_BOXATR_FORMULA ); + pBoxFormat2->ResetFormatAttr( RES_BOXATR_FORMAT ); + pBoxFormat2->ResetFormatAttr( RES_BOXATR_VALUE ); } else { @@ -2121,8 +2121,8 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if (!rFormula.isEmpty()) { // formula cell: insert formula if valid - SwTblBoxFormula aFormulaItem( rFormula ); - pBoxFmt2->SetFmtAttr( aFormulaItem ); + SwTableBoxFormula aFormulaItem( rFormula ); + pBoxFormat2->SetFormatAttr( aFormulaItem ); } else if (!pCell->HasValue() && pCell->HasStringValue()) { @@ -2131,24 +2131,24 @@ SwTableBox *SwXMLTableContext::MakeTableBox( // Solution: the number format will be removed, // the cell gets the default text format. const SfxPoolItem* pItem = NULL; - if( pBoxFmt->GetItemState( RES_BOXATR_FORMAT, false, &pItem ) + if( pBoxFormat->GetItemState( RES_BOXATR_FORMAT, false, &pItem ) == SfxItemState::SET ) { - const SwDoc* pDoc = pBoxFmt->GetDoc(); + const SwDoc* pDoc = pBoxFormat->GetDoc(); const SvNumberFormatter* pNumberFormatter = pDoc ? pDoc->GetNumberFormatter() : 0; - const SwTblBoxNumFormat* pNumFormat = - static_cast<const SwTblBoxNumFormat*>( pItem ); + const SwTableBoxNumFormat* pNumFormat = + static_cast<const SwTableBoxNumFormat*>( pItem ); if( pNumFormat != NULL && pNumberFormatter && !pNumberFormatter->GetEntry( pNumFormat->GetValue() )->IsTextFormat() ) - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMAT ); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT ); } } // always insert value, even if default if( pCell->HasValue() ) { - SwTblBoxValue aValueItem( pCell->GetValue() ); - pBoxFmt2->SetFmtAttr( aValueItem ); + SwTableBoxValue aValueItem( pCell->GetValue() ); + pBoxFormat2->SetFormatAttr( aValueItem ); } } @@ -2160,15 +2160,15 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if( pCell->IsProtected() ) { SvxProtectItem aProtectItem( RES_PROTECT ); - aProtectItem.SetCntntProtect( true ); - pBoxFmt2->SetFmtAttr( aProtectItem ); + aProtectItem.SetContentProtect( true ); + pBoxFormat2->SetFormatAttr( aProtectItem ); } // restore old modify-lock state if (! bModifyLocked) - pBoxFmt2->UnlockModify(); + pBoxFormat2->UnlockModify(); - pBoxFmt2->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nColWidth ) ); + pBoxFormat2->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, nColWidth ) ); return pBox; } @@ -2187,14 +2187,14 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, } else { - pLine = new SwTableLine( pLineFmt, 0, pUpper ); + pLine = new SwTableLine( pLineFormat, 0, pUpper ); } // TODO: Share formats! - SwFrmFmt *pFrmFmt = pLine->ClaimFrmFmt(); - SwFmtFillOrder aFillOrder( pFrmFmt->GetFillOrder() ); - pFrmFmt->ResetAllFmtAttr(); // #i73790# - method renamed - pFrmFmt->SetFmtAttr( aFillOrder ); + SwFrameFormat *pFrameFormat = pLine->ClaimFrameFormat(); + SwFormatFillOrder aFillOrder( pFrameFormat->GetFillOrder() ); + pFrameFormat->ResetAllFormatAttr(); // #i73790# - method renamed + pFrameFormat->SetFormatAttr( aFillOrder ); const SfxItemSet *pAutoItemSet = 0; const OUString& rStyleName = (*pRows)[nTopRow].GetStyleName(); @@ -2204,7 +2204,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, XML_STYLE_FAMILY_TABLE_ROW, rStyleName, &pAutoItemSet ) ) { if( pAutoItemSet ) - pFrmFmt->SetFmtAttr( *pAutoItemSet ); + pFrameFormat->SetFormatAttr( *pAutoItemSet ); } SwTableBoxes& rBoxes = pLine->GetTabBoxes(); @@ -2651,7 +2651,7 @@ void SwXMLTableContext::MakeTable() SwXMLImport& rSwImport = GetSwImport(); - SwFrmFmt *pFrmFmt = pTableNode->GetTable().GetFrmFmt(); + SwFrameFormat *pFrameFormat = pTableNode->GetTable().GetFrameFormat(); sal_Int16 eHoriOrient = text::HoriOrientation::FULL; bool bSetHoriOrient = false; @@ -2676,7 +2676,7 @@ void SwXMLTableContext::MakeTable() if( SfxItemState::SET == pAutoItemSet->GetItemState( RES_HORI_ORIENT, false, &pItem ) ) { - eHoriOrient = static_cast<const SwFmtHoriOrient *>(pItem)->GetHoriOrient(); + eHoriOrient = static_cast<const SwFormatHoriOrient *>(pItem)->GetHoriOrient(); switch( eHoriOrient ) { case text::HoriOrientation::FULL: @@ -2702,10 +2702,10 @@ void SwXMLTableContext::MakeTable() bSetHoriOrient = true; } - const SwFmtFrmSize *pSize = 0; + const SwFormatFrmSize *pSize = 0; if( SfxItemState::SET == pAutoItemSet->GetItemState( RES_FRM_SIZE, false, &pItem ) ) - pSize = static_cast<const SwFmtFrmSize *>(pItem); + pSize = static_cast<const SwFormatFrmSize *>(pItem); switch( eHoriOrient ) { @@ -2751,7 +2751,7 @@ void SwXMLTableContext::MakeTable() break; } - pFrmFmt->SetFmtAttr( *pAutoItemSet ); + pFrameFormat->SetFormatAttr( *pAutoItemSet ); } else { @@ -2765,21 +2765,21 @@ void SwXMLTableContext::MakeTable() pBox1->pSttNd = pSttNd1; pLine1->GetTabBoxes().erase( pLine1->GetTabBoxes().begin() ); - pLineFmt = static_cast<SwTableLineFmt*>(pLine1->GetFrmFmt()); - pBoxFmt = static_cast<SwTableBoxFmt*>(pBox1->GetFrmFmt()); + pLineFormat = static_cast<SwTableLineFormat*>(pLine1->GetFrameFormat()); + pBoxFormat = static_cast<SwTableBoxFormat*>(pBox1->GetFrameFormat()); _MakeTable( 0 ); if( bSetHoriOrient ) - pFrmFmt->SetFmtAttr( SwFmtHoriOrient( 0, eHoriOrient ) ); + pFrameFormat->SetFormatAttr( SwFormatHoriOrient( 0, eHoriOrient ) ); // This must be after the call to _MakeTable, because nWidth might be // changed there. - pFrmFmt->LockModify(); - SwFmtFrmSize aSize( ATT_VAR_SIZE, nWidth ); + pFrameFormat->LockModify(); + SwFormatFrmSize aSize( ATT_VAR_SIZE, nWidth ); aSize.SetWidthPercent( nPrcWidth ); - pFrmFmt->SetFmtAttr( aSize ); - pFrmFmt->UnlockModify(); + pFrameFormat->SetFormatAttr( aSize ); + pFrameFormat->UnlockModify(); for( size_t i=0; i<pRows->size(); i++ ) (*pRows)[i].Dispose(); @@ -2789,7 +2789,7 @@ void SwXMLTableContext::MakeTable() { // change existing table into DDE table: // 1) Get DDE field type (get data from dde-source context), - SwDDEFieldType* pFldType = lcl_GetDDEFieldType( pDDESource, + SwDDEFieldType* pFieldType = lcl_GetDDEFieldType( pDDESource, pTableNode ); // 2) release the DDE source context, @@ -2797,7 +2797,7 @@ void SwXMLTableContext::MakeTable() // 3) create new DDE table, and SwDDETable* pDDETable = new SwDDETable( pTableNode->GetTable(), - pFldType, false ); + pFieldType, false ); // 4) set new (DDE)table at node. pTableNode->SetNewTable(pDDETable, false); @@ -2815,8 +2815,8 @@ void SwXMLTableContext::MakeTable() void SwXMLTableContext::MakeTable( SwTableBox *pBox, sal_Int32 nW ) { //FIXME: here would be a great place to handle XmlId for subtable - pLineFmt = GetParentTable()->pLineFmt; - pBoxFmt = GetParentTable()->pBoxFmt; + pLineFormat = GetParentTable()->pLineFormat; + pBoxFormat = GetParentTable()->pBoxFormat; nWidth = nW; bRelWidth = GetParentTable()->bRelWidth; @@ -2840,14 +2840,14 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( Reference<XUnoTunnel> xCrsrTunnel( GetImport().GetTextImport()->GetCursor(), UNO_QUERY); OSL_ENSURE( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" ); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); if( bFirstSection ) { // The Cursor already is in the first section - pStNd = pTxtCrsr->GetPaM()->GetNode().FindTableBoxStartNode(); + pStNd = pTextCrsr->GetPaM()->GetNode().FindTableBoxStartNode(); bFirstSection = false; GetImport().GetTextImport()->SetStyleAndAttrs( GetImport(), GetImport().GetTextImport()->GetCursor(), "Standard", true ); @@ -2865,8 +2865,8 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( } sal_uInt32 nOffset = pPrevSttNd ? 1UL : 0UL; SwNodeIndex aIdx( *pEndNd, nOffset ); - SwTxtFmtColl *pColl = - pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false ); + SwTextFormatColl *pColl = + pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD, false ); pStNd = pDoc->GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode, pColl ); // Consider the case that a table is defined without a row. @@ -2874,8 +2874,8 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( { pBox1->pSttNd = pStNd; - SwCntntNode *pCNd = pDoc->GetNodes()[ pStNd->GetIndex() + 1 ] - ->GetCntntNode(); + SwContentNode *pCNd = pDoc->GetNodes()[ pStNd->GetIndex() + 1 ] + ->GetContentNode(); SwPosition aPos( *pCNd ); aPos.nContent.Assign( pCNd, 0U ); diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index f5017fbaf909..2882cb41fad3 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -32,8 +32,8 @@ class SwTableNode; class SwTableBox; class SwTableLine; class SwStartNode; -class SwTableBoxFmt; -class SwTableLineFmt; +class SwTableBoxFormat; +class SwTableLineFormat; class SwXMLTableCell_Impl; class SwXMLTableRow_Impl; typedef boost::ptr_vector<SwXMLTableRow_Impl> SwXMLTableRows_Impl; @@ -71,14 +71,14 @@ class SwXMLTableContext : public XMLTextTableContext SwTableBox *pBox1; const SwStartNode *pSttNd1; - SwTableBoxFmt *pBoxFmt; - SwTableLineFmt *pLineFmt; + SwTableBoxFormat *pBoxFormat; + SwTableLineFormat *pLineFormat; // hash map of shared format, indexed by the (XML) style name, // the column width, and protection flag - typedef std::unordered_map<TableBoxIndex,SwTableBoxFmt*, - TableBoxIndexHasher> map_BoxFmt; - map_BoxFmt* pSharedBoxFormats; + typedef std::unordered_map<TableBoxIndex,SwTableBoxFormat*, + TableBoxIndexHasher> map_BoxFormat; + map_BoxFormat* pSharedBoxFormats; SvXMLImportContextRef xParentTable; // if table is a sub table @@ -118,8 +118,8 @@ class SwXMLTableContext : public XMLTextTableContext void FixRowSpan( sal_uInt32 nRow, sal_uInt32 nCol, sal_uInt32 nColSpan ); void ReplaceWithEmptyCell( sal_uInt32 nRow, sal_uInt32 nCol, bool bRows ); - /** sets the appropriate SwTblBoxFmt at pBox. */ - SwTableBoxFmt* GetSharedBoxFormat( + /** sets the appropriate SwTableBoxFormat at pBox. */ + SwTableBoxFormat* GetSharedBoxFormat( SwTableBox* pBox, /// the table box const OUString& rStyleName, /// XML style name sal_Int32 nColumnWidth, /// width of column diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 0fb0538b8520..aaae93503da0 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -65,7 +65,7 @@ enum SvEmbeddedObjectTypes SV_EMBEDDED_FRAME }; -SwNoTxtNode *SwXMLTextParagraphExport::GetNoTxtNode( +SwNoTextNode *SwXMLTextParagraphExport::GetNoTextNode( const Reference < XPropertySet >& rPropSet ) { Reference<XUnoTunnel> xCrsrTunnel( rPropSet, UNO_QUERY ); @@ -73,10 +73,10 @@ SwNoTxtNode *SwXMLTextParagraphExport::GetNoTxtNode( SwXFrame *pFrame = reinterpret_cast< SwXFrame * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( SwXFrame::getUnoTunnelId() ))); assert(pFrame && "SwXFrame missing"); - SwFrmFmt *pFrmFmt = pFrame->GetFrmFmt(); - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx(); - return pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTxtNode(); + SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat(); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + const SwNodeIndex *pNdIdx = rContent.GetContentIdx(); + return pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode(); } void SwXMLTextParagraphExport::exportStyleContent( @@ -93,13 +93,13 @@ void SwXMLTextParagraphExport::exportStyleContent( if( pStyle && SFX_STYLE_FAMILY_PARA == pStyle->GetFamily() ) { const SwDoc *pDoc = pStyle->GetDoc(); - const SwTxtFmtColl *pColl = - pDoc->FindTxtFmtCollByName( pStyle->GetStyleName() ); + const SwTextFormatColl *pColl = + pDoc->FindTextFormatCollByName( pStyle->GetStyleName() ); OSL_ENSURE( pColl, "There is the text collection?" ); if( pColl && RES_CONDTXTFMTCOLL == pColl->Which() ) { - const SwFmtCollConditions& rConditions = - static_cast<const SwConditionTxtFmtColl *>(pColl)->GetCondColls(); + const SwFormatCollConditions& rConditions = + static_cast<const SwConditionTextFormatColl *>(pColl)->GetCondColls(); for( size_t i=0; i < rConditions.size(); ++i ) { const SwCollCondition& rCond = rConditions[i]; @@ -142,7 +142,7 @@ void SwXMLTextParagraphExport::exportStyleContent( break; } OSL_ENSURE( eFunc != XML_TOKEN_INVALID, - "SwXMLExport::ExportFmt: unknown condition" ); + "SwXMLExport::ExportFormat: unknown condition" ); if( eFunc != XML_TOKEN_INVALID ) { OUString sCond = GetXMLToken(eFunc) + "()"; @@ -155,7 +155,7 @@ void SwXMLTextParagraphExport::exportStyleContent( XML_CONDITION, sCond ); OUString aString; SwStyleNameMapper::FillProgName( - rCond.GetTxtFmtColl()->GetName(), + rCond.GetTextFormatColl()->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true); @@ -324,7 +324,7 @@ static void lcl_addFrameProperties( void SwXMLTextParagraphExport::_collectTextEmbeddedAutoStyles( const Reference < XPropertySet > & rPropSet ) { - SwOLENode *pOLENd = GetNoTxtNode( rPropSet )->GetOLENode(); + SwOLENode *pOLENd = GetNoTextNode( rPropSet )->GetOLENode(); svt::EmbeddedObjectRef& rObjRef = pOLENd->GetOLEObj().GetObject(); if( !rObjRef.is() ) return; @@ -360,7 +360,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( const Reference < XPropertySet > & rPropSet, const Reference < XPropertySetInfo > & rPropSetInfo ) { - SwOLENode *pOLENd = GetNoTxtNode( rPropSet )->GetOLENode(); + SwOLENode *pOLENd = GetNoTextNode( rPropSet )->GetOLENode(); SwOLEObj& rOLEObj = pOLENd->GetOLEObj(); svt::EmbeddedObjectRef& rObjRef = rOLEObj.GetObject(); if( !rObjRef.is() ) @@ -465,9 +465,9 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( sURL = GetExport().AddEmbeddedObject( sURL ); lcl_addURL( rXMLExport, sURL, false ); } - if( SV_EMBEDDED_OWN == nType && !pOLENd->GetChartTblName().isEmpty() ) + if( SV_EMBEDDED_OWN == nType && !pOLENd->GetChartTableName().isEmpty() ) { - OUString sRange( pOLENd->GetChartTblName() ); + OUString sRange( pOLENd->GetChartTableName() ); OUStringBuffer aBuffer( sRange.getLength() + 2 ); for( sal_Int32 i=0; i < sRange.getLength(); i++ ) { diff --git a/sw/source/filter/xml/xmltexte.hxx b/sw/source/filter/xml/xmltexte.hxx index 98fe1fbf47cb..0131f1d414b1 100644 --- a/sw/source/filter/xml/xmltexte.hxx +++ b/sw/source/filter/xml/xmltexte.hxx @@ -25,7 +25,7 @@ class SwXMLExport; class SvXMLAutoStylePoolP; -class SwNoTxtNode; +class SwNoTextNode; namespace com { namespace sun { namespace star { namespace style { class XStyle; } } } } @@ -41,7 +41,7 @@ class SwXMLTextParagraphExport : public XMLTextParagraphExport const SvGlobalName aIFrameClassId; const SvGlobalName aOutplaceClassId; - static SwNoTxtNode *GetNoTxtNode( + static SwNoTextNode *GetNoTextNode( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& rPropSet ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 5a70eb307cc9..1b3f08d787c0 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -105,10 +105,10 @@ static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet, nHeight = convertMm100ToTwip( nHeight ); if( nHeight < MINFLY ) nHeight = MINFLY; - rItemSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, nWidth, nHeight ) ); + rItemSet.Put( SwFormatFrmSize( ATT_FIX_SIZE, nWidth, nHeight ) ); } - SwFmtAnchor aAnchor( FLY_AT_CHAR ); + SwFormatAnchor aAnchor( FLY_AT_CHAR ); rItemSet.Put( aAnchor ); if( pTwipWidth ) @@ -186,21 +186,21 @@ bool SwXMLTextImportHelper::IsInHeaderFooter() const uno::Reference<XUnoTunnel> xCrsrTunnel( const_cast<SwXMLTextImportHelper *>(this)->GetCursor(), UNO_QUERY ); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - SAL_WARN_IF(!pTxtCrsr, "sw.uno", "SwXTextCursor missing"); - SwDoc *pDoc = pTxtCrsr ? pTxtCrsr->GetDoc() : NULL; + SAL_WARN_IF(!pTextCrsr, "sw.uno", "SwXTextCursor missing"); + SwDoc *pDoc = pTextCrsr ? pTextCrsr->GetDoc() : NULL; - return pDoc && pDoc->IsInHeaderFooter( pTxtCrsr->GetPaM()->GetPoint()->nNode ); + return pDoc && pDoc->IsInHeaderFooter( pTextCrsr->GetPaM()->GetPoint()->nNode ); } -static SwOLENode *lcl_GetOLENode( const SwFrmFmt *pFrmFmt ) +static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat ) { SwOLENode *pOLENd = 0; - if( pFrmFmt ) + if( pFrameFormat ) { - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx(); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + const SwNodeIndex *pNdIdx = rContent.GetContentIdx(); pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode(); } OSL_ENSURE( pOLENd, "Where is the OLE node" ); @@ -211,7 +211,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( SvXMLImport& rImport, const OUString& rHRef, const OUString& rStyleName, - const OUString& rTblName, + const OUString& rTableName, sal_Int32 nWidth, sal_Int32 nHeight ) { // this method will modify the document directly -> lock SolarMutex @@ -230,9 +230,9 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( uno::Reference<XUnoTunnel> xCrsrTunnel( GetCursor(), UNO_QUERY ); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - SAL_WARN_IF(!pTxtCrsr, "sw.uno", "SwXTextCursor missing"); + SAL_WARN_IF(!pTextCrsr, "sw.uno", "SwXTextCursor missing"); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, @@ -242,7 +242,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( lcl_putHeightAndWidth( aItemSet, nHeight, nWidth, &aTwipSize.Height(), &aTwipSize.Width() ); - SwFrmFmt *pFrmFmt = 0; + SwFrameFormat *pFrameFormat = 0; SwOLENode *pOLENd = 0; if( rHRef.copy( 0, nPos ) == "vnd.sun.star.ServiceName" ) { @@ -286,14 +286,14 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MAP_TWIP ); } - if( pTxtCrsr ) + if( pTextCrsr ) { - pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), + pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, NULL, NULL ); - pOLENd = lcl_GetOLENode( pFrmFmt ); + pOLENd = lcl_GetOLENode( pFrameFormat ); } if( pOLENd ) @@ -308,8 +308,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( { // check whether an object with this name already exists in the document OUString aName; - SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) + SwIterator<SwContentNode,SwFormatColl> aIter( *pDoc->GetDfltGrfFormatColl() ); + for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pExistingOLENd = pNd->GetOLENode(); if( pExistingOLENd ) @@ -342,47 +342,47 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( // the correct aspect will be set later // TODO/LATER: Actually it should be set here - if( pTxtCrsr ) + if( pTextCrsr ) { - pFrmFmt = pDoc->getIDocumentContentOperations().InsertOLE( *pTxtCrsr->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, NULL, NULL ); - pOLENd = lcl_GetOLENode( pFrmFmt ); + pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCrsr->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, NULL, NULL ); + pOLENd = lcl_GetOLENode( pFrameFormat ); } aObjName = aName; } - if( !pFrmFmt ) + if( !pFrameFormat ) return xPropSet; if( IsInsertMode() ) { if( !pOLENd ) - pOLENd = lcl_GetOLENode( pFrmFmt ); + pOLENd = lcl_GetOLENode( pFrameFormat ); if( pOLENd ) pOLENd->SetOLESizeInvalid( true ); } xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( - *pDoc, pFrmFmt), uno::UNO_QUERY); + *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) { // req for z-order - SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrmFmt*>(pFrmFmt)); + SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat)); } - if( !rTblName.isEmpty() ) + if( !rTableName.isEmpty() ) { - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx(); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + const SwNodeIndex *pNdIdx = rContent.GetContentIdx(); SwOLENode *pOLENode = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode(); OSL_ENSURE( pOLENode, "Where is the OLE node" ); - OUStringBuffer aBuffer( rTblName.getLength() ); + OUStringBuffer aBuffer( rTableName.getLength() ); bool bQuoted = false; bool bEscape = false; bool bError = false; - for( sal_Int32 i=0; i < rTblName.getLength(); i++ ) + for( sal_Int32 i=0; i < rTableName.getLength(); i++ ) { bool bEndOfNameFound = false; - sal_Unicode c = rTblName[i]; + sal_Unicode c = rTableName[i]; switch( c ) { case '\'': @@ -439,8 +439,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( } if( !bError ) { - OUString sTblName( aBuffer.makeStringAndClear() ); - pOLENode->SetChartTblName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTblName ) ); + OUString sTableName( aBuffer.makeStringAndClear() ); + pOLENode->SetChartTableName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTableName ) ); } } @@ -534,7 +534,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( SvXMLImport& rImport, const OUString& rHRef, const OUString& /*rStyleName*/, - const OUString& /*rTblName*/, + const OUString& /*rTableName*/, sal_Int32 nWidth, sal_Int32 nHeight ) { // this method will modify the document directly -> lock SolarMutex @@ -544,9 +544,9 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::Reference<XUnoTunnel> xCrsrTunnel( GetCursor(), UNO_QUERY ); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, @@ -593,7 +593,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::UNO_QUERY_THROW ); { - SwFrmFmt *pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), + SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, NULL, @@ -602,11 +602,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( // TODO/LATER: in future may need a way to set replacement image url to the link ( may be even to the object ), needs oasis cws??? xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( - *pDoc, pFrmFmt), uno::UNO_QUERY); + *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) { SwXFrame::GetOrCreateSdrObject(* - static_cast<SwFlyFrmFmt*>(pFrmFmt)); // req for z-order + static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order } } } @@ -614,7 +614,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( { } - // TODO/LATER: should the rStyleName and rTblName be handled as for usual embedded object? + // TODO/LATER: should the rStyleName and rTableName be handled as for usual embedded object? return xPropSet; } @@ -632,10 +632,10 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( uno::Reference < XPropertySet > xPropSet; uno::Reference<XUnoTunnel> xCrsrTunnel( GetCursor(), UNO_QUERY ); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); - SwDoc *pDoc = pTxtCrsr->GetDoc(); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); + SwDoc *pDoc = pTextCrsr->GetDoc(); SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END ); @@ -655,17 +655,17 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( Size( nWidth, nHeight ), MAP_100TH_MM ); - SwFrmFmt *pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), + SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT ), &aAppletImpl.GetItemSet(), NULL, NULL); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( - *pDoc, pFrmFmt), uno::UNO_QUERY); + *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) { // req for z-order - SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrmFmt*>(pFrmFmt)); + SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat)); } return xPropSet; @@ -679,10 +679,10 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( uno::Reference < XPropertySet > xPropSet; uno::Reference<XUnoTunnel> xCrsrTunnel( GetCursor(), UNO_QUERY ); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); - SwDoc *pDoc = pTxtCrsr->GetDoc(); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); + SwDoc *pDoc = pTextCrsr->GetDoc(); SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END ); @@ -730,17 +730,17 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( makeAny( OUString( rMimeType ) ) ); } - SwFrmFmt *pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), + SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, NULL, NULL); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( - *pDoc, pFrmFmt), uno::UNO_QUERY); + *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) { SwXFrame::GetOrCreateSdrObject(* - static_cast<SwFlyFrmFmt*>(pFrmFmt)); // req for z-order + static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order } } } @@ -762,10 +762,10 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra uno::Reference < XPropertySet > xPropSet; uno::Reference<XUnoTunnel> xCrsrTunnel( GetCursor(), UNO_QUERY ); assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); - OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( + OTextCursorHelper *pTextCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); - SwDoc *pDoc = pTxtCrsr->GetDoc(); + OSL_ENSURE( pTextCrsr, "SwXTextCursor missing" ); + SwDoc *pDoc = pTextCrsr->GetDoc(); SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END ); @@ -883,18 +883,18 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra makeAny( sal_Int32( aMargin.Height() ) ) ); } - SwFrmFmt *pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), + SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCrsr->GetPaM(), ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aItemSet, NULL, NULL); xPropSet.set(SwXTextEmbeddedObject::CreateXTextEmbeddedObject( - *pDoc, pFrmFmt), uno::UNO_QUERY); + *pDoc, pFrameFormat), uno::UNO_QUERY); if( pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) { // req for z-order SwXFrame::GetOrCreateSdrObject(* - static_cast<SwFlyFrmFmt*>(pFrmFmt)); + static_cast<SwFlyFrameFormat*>(pFrameFormat)); } } } @@ -917,10 +917,10 @@ void SwXMLTextImportHelper::endAppletOrPlugin( SwXFrame *pFrame = reinterpret_cast< SwXFrame * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( SwXFrame::getUnoTunnelId() ))); OSL_ENSURE( pFrame, "SwXFrame missing" ); - SwFrmFmt *pFrmFmt = pFrame->GetFrmFmt(); - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx(); - SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTxtNode()->GetOLENode(); + SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat(); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + const SwNodeIndex *pNdIdx = rContent.GetContentIdx(); + SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode(); SwOLEObj& rOLEObj = pOLENd->GetOLEObj(); uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() ); diff --git a/sw/source/filter/xml/xmltexti.hxx b/sw/source/filter/xml/xmltexti.hxx index 83868b11b984..23e4051eab23 100644 --- a/sw/source/filter/xml/xmltexti.hxx +++ b/sw/source/filter/xml/xmltexti.hxx @@ -52,14 +52,14 @@ public: createAndInsertOLEObject( SvXMLImport& rImport, const OUString& rHRef, const OUString& rStyleName, - const OUString& rTblName, + const OUString& rTableName, sal_Int32 nWidth, sal_Int32 nHeight ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> createAndInsertOOoLink( SvXMLImport& rImport, const OUString& rHRef, const OUString& rStyleName, - const OUString& rTblName, + const OUString& rTableName, sal_Int32 nWidth, sal_Int32 nHeight ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> |