summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlitemi.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/xml/xmlitemi.cxx')
-rw-r--r--sw/source/filter/xml/xmlitemi.cxx268
1 files changed, 2 insertions, 266 deletions
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index 4fae5b362f1f..3d57a4745709 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlitemi.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:15:00 $
+ * last change: $Author: mib $ $Date: 2000-11-07 14:05:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -133,14 +133,6 @@
#include <unomid.h>
#endif
-#ifndef _XMDROPI_HXX
-#include "xmldropi.hxx"
-#endif
-#ifdef XML_CORE_API
-#ifndef _XMLTBLI_HXX
-#include "xmltbli.hxx"
-#endif
-#endif
#ifndef _XMLIMP_HXX
#include "xmlimp.hxx"
#endif
@@ -149,139 +141,11 @@ using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-#ifdef XML_CORE_API
-extern SvXMLItemMapEntry aXMLParaItemMap[];
-#endif
extern SvXMLItemMapEntry aXMLTableItemMap[];
extern SvXMLItemMapEntry aXMLTableColItemMap[];
extern SvXMLItemMapEntry aXMLTableRowItemMap[];
extern SvXMLItemMapEntry aXMLTableCellItemMap[];
-#ifdef XML_CORE_API
-class SwXMLImportTextItemMapper_Impl: public SvXMLImportItemMapper
-{
- SvI18NMap& rI18NMap;
- SwDoc& rDoc;
-
-public:
-
- SwXMLImportTextItemMapper_Impl( SvXMLItemMapEntriesRef rMapEntries,
- SwDoc& rD, SvI18NMap& rI18NMap );
- virtual ~SwXMLImportTextItemMapper_Impl();
-
- virtual sal_Bool handleSpecialItem( const SvXMLItemMapEntry& rEntry,
- SfxPoolItem& rItem,
- SfxItemSet& rSet,
- const OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
-
- virtual void finished( SfxItemSet& rSet ) const;
-};
-
-SwXMLImportTextItemMapper_Impl::SwXMLImportTextItemMapper_Impl(
- SvXMLItemMapEntriesRef rMapEntries,
- SwDoc& rD, SvI18NMap& rI18NM ) :
- SvXMLImportItemMapper( rMapEntries, RES_UNKNOWNATR_CONTAINER),
- rDoc( rD ),
- rI18NMap( rI18NM )
-{
-}
-
-SwXMLImportTextItemMapper_Impl::~SwXMLImportTextItemMapper_Impl()
-{
-}
-
-sal_Bool SwXMLImportTextItemMapper_Impl::handleSpecialItem(
- const SvXMLItemMapEntry& rEntry,
- SfxPoolItem& rItem,
- SfxItemSet& rItemSet,
- const OUString& rValue,
- const SvXMLUnitConverter& rUnitConv,
- const SvXMLNamespaceMap& ) const
-{
- sal_Bool bRet = sal_False;
- switch( rItem.Which() )
- {
- case RES_TXTATR_CHARFMT:
- DBG_ASSERT( !this,
- "SwXMLImportTextItemMapper_Impl::handleSpecialItem: char fmt unexpected" );
- break;
-
- case RES_PARATR_NUMRULE:
- if( rValue.getLength() )
- {
- OUString sName( rI18NMap.Get( SFX_STYLE_FAMILY_PSEUDO, rValue ) );
- ((SwNumRuleItem&)rItem).SetValue( sName );
- bRet = sal_True;
- }
- break;
-
- case RES_CHRATR_LANGUAGE:
- // If the item is not contained in the item set, its the default
- // value. To set language and contry individually, we have to clear
- // its value.
- if( SFX_ITEM_SET != rItemSet.GetItemState( RES_CHRATR_LANGUAGE,
- sal_False ) )
- {
- ((SvxLanguageItem &)rItem).SetLanguage( LANGUAGE_NONE );
- }
- bRet = rItem.importXML( rValue, rEntry.nMemberId, rUnitConv );
- break;
- }
-
- return bRet;
-}
-
-void SwXMLImportTextItemMapper_Impl::finished( SfxItemSet& rSet ) const
-{
- const SfxPoolItem *pItem;
-
- if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_FONT, sal_False,
- &pItem ) )
- {
- const SvxFontItem *pFont = (const SvxFontItem *)pItem;
- // delete font items that have no family name
- if( 0 == pFont->GetFamilyName().Len() )
- rSet.ClearItem( RES_CHRATR_FONT );
- else if( RTL_TEXTENCODING_DONTKNOW == pFont->GetCharSet() )
- {
- SvxFontItem aFont( *pFont );
- aFont.GetCharSet() = gsl_getSystemTextEncoding();
- rSet.Put( aFont );
- }
- }
-
- // ensure that box item have a distance to a border.
- if( SFX_ITEM_SET == rSet.GetItemState( RES_BOX, sal_False, &pItem ) )
- {
- const SvxBoxItem *pBox = (const SvxBoxItem *)pItem;
- sal_uInt16 aLines[4] = { BOX_LINE_TOP, BOX_LINE_BOTTOM,
- BOX_LINE_LEFT, BOX_LINE_RIGHT };
- sal_uInt16 i;
- for( i=0; i<4; i++ )
- {
- if( pBox->GetLine( aLines[i] ) &&
- pBox->GetDistance( aLines[i] ) < MIN_BORDER_DIST )
- break;
- }
- if( i < 4 )
- {
- SvxBoxItem aBox( *pBox );
- for( /*i=0*/; i<4; i++ ) // i points to the mod. line
- {
- if( aBox.GetLine( aLines[i] ) &&
- aBox.GetDistance( aLines[i] ) < MIN_BORDER_DIST )
- aBox.SetDistance( MIN_BORDER_DIST, aLines[i] );
- }
- rSet.Put( aBox );
- }
- }
-}
-#endif
-
-// ---------------------------------------------------------------------
-
class SwXMLImportTableItemMapper_Impl: public SvXMLImportItemMapper
{
@@ -375,10 +239,6 @@ void SwXMLImportTableItemMapper_Impl::finished( SfxItemSet& rSet ) const
class SwXMLItemSetContext_Impl : public SvXMLItemSetContext
{
SvXMLImportContextRef xBackground;
-#ifdef XML_CORE_API
- SvXMLImportContextRef xTabStop;
- SvXMLImportContextRef xDropCap;
-#endif
public:
SwXMLItemSetContext_Impl( SwXMLImport& rImport, sal_uInt16 nPrfx,
@@ -411,22 +271,6 @@ SwXMLItemSetContext_Impl::SwXMLItemSetContext_Impl(
SwXMLItemSetContext_Impl::~SwXMLItemSetContext_Impl()
{
-#ifdef XML_CORE_API
- if( xTabStop.Is() )
- {
- Any aAny;
- ((SvxXMLTabStopImportContext*)&xTabStop)->fillTabStops( aAny );
- SvxTabStopItem aTabStop( RES_PARATR_TABSTOP );
- ((SfxPoolItem *)&aTabStop)->PutValue( aAny, 0 );
- rItemSet.Put( aTabStop );
- }
- if( xDropCap.Is() )
- {
- const SwFmtDrop& rItem =
- ((SwXMLFmtDropImportContext*)&xDropCap)->GetItem();
- rItemSet.Put( rItem );
- }
-#endif
if( xBackground.Is() )
{
const SvxBrushItem& rItem =
@@ -447,22 +291,6 @@ SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext(
switch( rEntry.nWhichId )
{
-#ifdef XML_CORE_API
- case RES_PARATR_TABSTOP:
- pContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix,
- rLocalName, rUnitConv );
- xTabStop = pContext;
- break;
-
- case RES_PARATR_DROP:
- pContext = new SwXMLFmtDropImportContext( (SwXMLImport&)GetImport(),
- nPrefix, rLocalName,
- xAttrList, rUnitConv,
- RES_PARATR_DROP );
- xDropCap = pContext;
- break;
-#endif
-
case RES_BACKGROUND:
{
const SfxPoolItem *pItem;
@@ -498,14 +326,6 @@ void SwXMLImport::_InitItemImport()
{
pTwipUnitConv = new SvXMLUnitConverter( MAP_TWIP, MAP_TWIP );
-#ifdef XML_CORE_API
- SvXMLItemMapEntriesRef xParaItemMapEntries =
- new SvXMLItemMapEntries( aXMLParaItemMap );
-
- pParaItemMapper = new SwXMLImportTextItemMapper_Impl( xParaItemMapEntries,
- GetDoc(), GetI18NMap() );
-#endif
-
xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );
xTableColItemMap = new SvXMLItemMapEntries( aXMLTableColItemMap );
xTableRowItemMap = new SvXMLItemMapEntries( aXMLTableRowItemMap );
@@ -516,72 +336,31 @@ void SwXMLImport::_InitItemImport()
void SwXMLImport::_FinitItemImport()
{
-#ifdef XML_CORE_API
- delete pParaItemMapper;
-#endif
delete pTableItemMapper;
delete pTwipUnitConv;
}
-#ifdef XML_CORE_API
-SvXMLImportContext *SwXMLImport::CreateParaItemImportContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- SfxItemSet& rItemSet )
-{
- return new SwXMLItemSetContext_Impl( *this, nPrefix, rLocalName,
- xAttrList, rItemSet,
- GetParaItemMapper(),
- GetTwipUnitConverter() );
-}
-#endif
-
SvXMLImportContext *SwXMLImport::CreateTableItemImportContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList,
-#ifdef XML_CORE_API
- sal_uInt16 nSubFamily,
-#else
sal_uInt16 nFamily,
-#endif
SfxItemSet& rItemSet )
{
SvXMLItemMapEntriesRef xItemMap;
-#ifdef XML_CORE_API
- switch( nSubFamily )
-#else
switch( nFamily )
-#endif
{
-#ifdef XML_CORE_API
- case SW_STYLE_SUBFAMILY_TABLE:
-#else
case XML_STYLE_FAMILY_TABLE_TABLE:
-#endif
xItemMap = xTableItemMap;
break;
-#ifdef XML_CORE_API
- case SW_STYLE_SUBFAMILY_TABLE_COL:
-#else
case XML_STYLE_FAMILY_TABLE_COLUMN:
-#endif
xItemMap = xTableColItemMap;
break;
-#ifdef XML_CORE_API
- case SW_STYLE_SUBFAMILY_TABLE_LINE:
-#else
case XML_STYLE_FAMILY_TABLE_ROW:
-#endif
xItemMap = xTableRowItemMap;
break;
-#ifdef XML_CORE_API
- case SW_STYLE_SUBFAMILY_TABLE_BOX:
-#else
case XML_STYLE_FAMILY_TABLE_CELL:
-#endif
xItemMap = xTableCellItemMap;
break;
}
@@ -593,46 +372,3 @@ SvXMLImportContext *SwXMLImport::CreateTableItemImportContext(
GetTableItemMapper(),
GetTwipUnitConverter() );
}
-
-/*************************************************************************
-
- Source Code Control System - Header
-
- $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/xmlitemi.cxx,v 1.1.1.1 2000-09-18 17:15:00 hr Exp $
-
- Source Code Control System - Update
-
- $Log: not supported by cvs2svn $
- Revision 1.11 2000/09/18 16:05:07 willem.vandorp
- OpenOffice header added.
-
- Revision 1.10 2000/08/24 11:16:41 mib
- text import continued
-
- Revision 1.9 2000/08/02 14:52:39 mib
- text export continued
-
- Revision 1.8 2000/06/08 09:45:54 aw
- changed to use functionality from xmloff project now
-
- Revision 1.7 2000/05/03 12:08:05 mib
- unicode
-
- Revision 1.6 2000/03/13 14:33:44 mib
- UNO3
-
- Revision 1.5 2000/02/17 14:40:30 mib
- #70271#: XML table import
-
- Revision 1.3 2000/01/20 14:03:57 mib
- #70271#: deletion of unit converter
-
- Revision 1.2 2000/01/06 15:08:28 mib
- #70271#:separation of text/layout, cond. styles, adaptions to wd-xlink-19991229
-
- Revision 1.1 1999/12/14 07:32:58 mib
- #70271#: XML import/export of drop cap/register/language item, splitted swxmlat
-
-
-*************************************************************************/
-