Kaydet (Commit) 241bc767 authored tarafından Michael Brauer's avatar Michael Brauer

support of glossary documents

üst 76bd85b5
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlexp.cxx,v $ * $RCSfile: xmlexp.cxx,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: mib $ $Date: 2001-01-17 10:55:18 $ * last change: $Author: mib $ $Date: 2001-01-18 12:39:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -186,6 +186,7 @@ SwXMLExport::SwXMLExport() : ...@@ -186,6 +186,7 @@ SwXMLExport::SwXMLExport() :
bExportWholeDoc( bExpWholeDoc ), bExportWholeDoc( bExpWholeDoc ),
bExportFirstTableOnly( bExpFirstTableOnly ), bExportFirstTableOnly( bExpFirstTableOnly ),
#endif #endif
bBlock( sal_False ),
bShowProgress( sal_True ), bShowProgress( sal_True ),
sNumberFormat(RTL_CONSTASCII_USTRINGPARAM("NumberFormat")), sNumberFormat(RTL_CONSTASCII_USTRINGPARAM("NumberFormat")),
sCell(RTL_CONSTASCII_USTRINGPARAM("Cell")) sCell(RTL_CONSTASCII_USTRINGPARAM("Cell"))
...@@ -217,11 +218,19 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM, ...@@ -217,11 +218,19 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
} }
#endif #endif
void SwXMLExport::setBlockMode()
{
bBlock = sal_True;
}
sal_uInt32 SwXMLExport::exportDoc( const sal_Char *pClass ) sal_uInt32 SwXMLExport::exportDoc( const sal_Char *pClass )
{ {
if( !GetModel().is() ) if( !GetModel().is() )
return ERR_SWG_WRITE_ERROR; return ERR_SWG_WRITE_ERROR;
GetTextParagraphExport()->SetBlockMode( bBlock );
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText(); Reference < XText > xText = xTextDoc->getText();
Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY); Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlexp.hxx,v $ * $RCSfile: xmlexp.hxx,v $
* *
* $Revision: 1.13 $ * $Revision: 1.14 $
* *
* last change: $Author: mib $ $Date: 2001-01-17 10:55:19 $ * last change: $Author: mib $ $Date: 2001-01-18 12:39:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -112,6 +112,7 @@ class SwXMLExport : public SvXMLExport ...@@ -112,6 +112,7 @@ class SwXMLExport : public SvXMLExport
sal_Int32 nContentProgressStart; sal_Int32 nContentProgressStart;
sal_Bool bExportWholeDoc : 1;// export whole document? sal_Bool bExportWholeDoc : 1;// export whole document?
sal_Bool bBlock : 1; // export text block?
sal_Bool bExportFirstTableOnly : 1; sal_Bool bExportFirstTableOnly : 1;
sal_Bool bShowProgress : 1; sal_Bool bShowProgress : 1;
...@@ -175,6 +176,8 @@ public: ...@@ -175,6 +176,8 @@ public:
#endif #endif
virtual ~SwXMLExport(); virtual ~SwXMLExport();
void setBlockMode();
virtual sal_uInt32 exportDoc( const sal_Char *pClass=0 ); virtual sal_uInt32 exportDoc( const sal_Char *pClass=0 );
inline const SvXMLUnitConverter& GetTwipUnitConverter() const; inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
...@@ -189,6 +192,7 @@ public: ...@@ -189,6 +192,7 @@ public:
} }
sal_Bool IsShowProgress() const { return bShowProgress; } sal_Bool IsShowProgress() const { return bShowProgress; }
sal_Bool IsBlockMode() const { return bBlock; }
}; };
inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlfmt.cxx,v $ * $RCSfile: xmlfmt.cxx,v $
* *
* $Revision: 1.11 $ * $Revision: 1.12 $
* *
* last change: $Author: mib $ $Date: 2001-01-05 17:12:21 $ * last change: $Author: mib $ $Date: 2001-01-18 12:39:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -985,7 +985,12 @@ sal_Bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const ...@@ -985,7 +985,12 @@ sal_Bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const
bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PSEUDO) != 0; bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PSEUDO) != 0;
break; break;
case XML_STYLE_FAMILY_TEXT_OUTLINE: case XML_STYLE_FAMILY_TEXT_OUTLINE:
bIns = !(rSwImport.IsInsertMode() || rSwImport.IsStylesOnlyMode()); case XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG:
case XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG:
case XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG:
case XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG:
bIns = !(rSwImport.IsInsertMode() || rSwImport.IsStylesOnlyMode() ||
rSwImport.IsBlockMode());
break; break;
default: default:
bIns = SvXMLStylesContext::InsertStyleFamily( nFamily ); bIns = SvXMLStylesContext::InsertStyleFamily( nFamily );
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlimp.cxx,v $ * $RCSfile: xmlimp.cxx,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: mib $ $Date: 2001-01-17 10:55:19 $ * last change: $Author: mib $ $Date: 2001-01-18 12:39:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -265,6 +265,7 @@ SvXMLImportContext *SwXMLImport::CreateContext( ...@@ -265,6 +265,7 @@ SvXMLImportContext *SwXMLImport::CreateContext(
SwXMLImport::SwXMLImport() : SwXMLImport::SwXMLImport() :
bLoadDoc( sal_True ), bLoadDoc( sal_True ),
bInsert( sal_False ), bInsert( sal_False ),
bBlock( sal_False ),
nStyleFamilyMask( SFX_STYLE_FAMILY_ALL ), nStyleFamilyMask( SFX_STYLE_FAMILY_ALL ),
pDocElemTokenMap( 0 ), pDocElemTokenMap( 0 ),
pTableElemTokenMap( 0 ), pTableElemTokenMap( 0 ),
...@@ -277,6 +278,8 @@ SwXMLImport::SwXMLImport() : ...@@ -277,6 +278,8 @@ SwXMLImport::SwXMLImport() :
_InitItemImport(); _InitItemImport();
} }
#ifdef XML_CORE_API
SwXMLImport::SwXMLImport( SwXMLImport::SwXMLImport(
SwDoc& rDoc, const SwPaM& rPaM, SwDoc& rDoc, const SwPaM& rPaM,
sal_Bool bLDoc, sal_Bool bInsertMode, sal_uInt16 nStyleFamMask, sal_Bool bLDoc, sal_Bool bInsertMode, sal_uInt16 nStyleFamMask,
...@@ -307,6 +310,7 @@ SwXMLImport::SwXMLImport( ...@@ -307,6 +310,7 @@ SwXMLImport::SwXMLImport(
xText->createTextCursorByRange( xTextRange ); xText->createTextCursorByRange( xTextRange );
GetTextImport()->SetCursor( xTextCursor ); GetTextImport()->SetCursor( xTextCursor );
} }
#endif
SwXMLImport::~SwXMLImport() SwXMLImport::~SwXMLImport()
{ {
...@@ -334,6 +338,12 @@ void SwXMLImport::setStyleInsertMode( sal_uInt16 nFamilies, ...@@ -334,6 +338,12 @@ void SwXMLImport::setStyleInsertMode( sal_uInt16 nFamilies,
bLoadDoc = sal_False; bLoadDoc = sal_False;
} }
void SwXMLImport::setBlockMode( )
{
bBlock = sal_True;
}
const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() throw() const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() throw()
{ {
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlimp.hxx,v $ * $RCSfile: xmlimp.hxx,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: mib $ $Date: 2001-01-17 10:55:19 $ * last change: $Author: mib $ $Date: 2001-01-18 12:39:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -110,6 +110,7 @@ class SwXMLImport: public SvXMLImport ...@@ -110,6 +110,7 @@ class SwXMLImport: public SvXMLImport
// loaded only sal_False means that // loaded only sal_False means that
// existing styles will be // existing styles will be
// overwritten. // overwritten.
sal_Bool bBlock : 1; // Load text block
sal_Bool bAutoStylesValid : 1; sal_Bool bAutoStylesValid : 1;
sal_Bool bProgressValid : 1; sal_Bool bProgressValid : 1;
sal_Bool bShowProgress : 1; sal_Bool bShowProgress : 1;
...@@ -136,6 +137,7 @@ protected: ...@@ -136,6 +137,7 @@ protected:
public: public:
SwXMLImport(); SwXMLImport();
#ifdef XML_CORE_API
SwXMLImport( SwDoc& rDoc, const SwPaM& rPaM, sal_Bool bLoadDoc, SwXMLImport( SwDoc& rDoc, const SwPaM& rPaM, sal_Bool bLoadDoc,
sal_Bool bInsertMode, sal_uInt16 nStyleFamMask, sal_Bool bInsertMode, sal_uInt16 nStyleFamMask,
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
...@@ -143,6 +145,7 @@ public: ...@@ -143,6 +145,7 @@ public:
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::document::XGraphicObjectResolver > &, ::com::sun::star::document::XGraphicObjectResolver > &,
SvStorage *pPkg ); SvStorage *pPkg );
#endif
~SwXMLImport(); ~SwXMLImport();
...@@ -151,6 +154,7 @@ public: ...@@ -151,6 +154,7 @@ public:
::com::sun::star::text::XTextRange > & rInsertPos ); ::com::sun::star::text::XTextRange > & rInsertPos );
void setStyleInsertMode( sal_uInt16 nFamilies, void setStyleInsertMode( sal_uInt16 nFamilies,
sal_Bool bOverwrite ); sal_Bool bOverwrite );
void setBlockMode();
// ::com::sun::star::xml::sax::XDocumentHandler // ::com::sun::star::xml::sax::XDocumentHandler
virtual void SAL_CALL startDocument(void) virtual void SAL_CALL startDocument(void)
...@@ -185,6 +189,7 @@ public: ...@@ -185,6 +189,7 @@ public:
sal_uInt16 GetStyleFamilyMask() const { return nStyleFamilyMask; } sal_uInt16 GetStyleFamilyMask() const { return nStyleFamilyMask; }
sal_Bool IsInsertMode() const { return bInsert; } sal_Bool IsInsertMode() const { return bInsert; }
sal_Bool IsStylesOnlyMode() const { return !bLoadDoc; } sal_Bool IsStylesOnlyMode() const { return !bLoadDoc; }
sal_Bool IsBlockMode() const { return bBlock; }
inline const SvXMLUnitConverter& GetTwipUnitConverter() const; inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
inline const SvXMLImportItemMapper& GetTableItemMapper() const; inline const SvXMLImportItemMapper& GetTableItemMapper() const;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlmeta.cxx,v $ * $RCSfile: xmlmeta.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: mib $ $Date: 2001-01-08 09:44:55 $ * last change: $Author: mib $ $Date: 2001-01-18 12:39:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -280,48 +280,51 @@ void SwXMLExport::_ExportMeta() ...@@ -280,48 +280,51 @@ void SwXMLExport::_ExportMeta()
{ {
SvXMLExport::_ExportMeta(); SvXMLExport::_ExportMeta();
OUStringBuffer aOut(16); if( !IsBlockMode() )
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
ASSERT( xTextTunnel.is(), "missing XUnoTunnel for Cursor" );
if( !xTextTunnel.is() )
return;
SwXText *pText = (SwXText *)xTextTunnel->getSomething(
SwXText::getUnoTunnelId() );
ASSERT( pText, "SwXText missing" );
if( !pText )
return;
SwDocStat aDocStat( pText->GetDoc()->GetDocStat() );
aOut.append( (sal_Int32)aDocStat.nTbl );
AddAttribute( XML_NAMESPACE_META, sXML_table_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nGrf );
AddAttribute( XML_NAMESPACE_META, sXML_image_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nOLE );
AddAttribute( XML_NAMESPACE_META, sXML_object_count,
aOut.makeStringAndClear() );
if( aDocStat.nPage )
{ {
aOut.append( (sal_Int32)aDocStat.nPage ); OUStringBuffer aOut(16);
AddAttribute( XML_NAMESPACE_META, sXML_page_count,
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
ASSERT( xTextTunnel.is(), "missing XUnoTunnel for Cursor" );
if( !xTextTunnel.is() )
return;
SwXText *pText = (SwXText *)xTextTunnel->getSomething(
SwXText::getUnoTunnelId() );
ASSERT( pText, "SwXText missing" );
if( !pText )
return;
SwDocStat aDocStat( pText->GetDoc()->GetDocStat() );
aOut.append( (sal_Int32)aDocStat.nTbl );
AddAttribute( XML_NAMESPACE_META, sXML_table_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nGrf );
AddAttribute( XML_NAMESPACE_META, sXML_image_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nOLE );
AddAttribute( XML_NAMESPACE_META, sXML_object_count,
aOut.makeStringAndClear() );
if( aDocStat.nPage )
{
aOut.append( (sal_Int32)aDocStat.nPage );
AddAttribute( XML_NAMESPACE_META, sXML_page_count,
aOut.makeStringAndClear() );
}
aOut.append( (sal_Int32)aDocStat.nPara );
AddAttribute( XML_NAMESPACE_META, sXML_paragraph_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nWord );
AddAttribute( XML_NAMESPACE_META, sXML_word_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nChar );
AddAttribute( XML_NAMESPACE_META, sXML_character_count,
aOut.makeStringAndClear() ); aOut.makeStringAndClear() );
SvXMLElementExport aElem( *this, XML_NAMESPACE_META,
sXML_document_statistic,
sal_True, sal_True );
} }
aOut.append( (sal_Int32)aDocStat.nPara );
AddAttribute( XML_NAMESPACE_META, sXML_paragraph_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nWord );
AddAttribute( XML_NAMESPACE_META, sXML_word_count,
aOut.makeStringAndClear() );
aOut.append( (sal_Int32)aDocStat.nChar );
AddAttribute( XML_NAMESPACE_META, sXML_character_count,
aOut.makeStringAndClear() );
SvXMLElementExport aElem( *this, XML_NAMESPACE_META,
sXML_document_statistic,
sal_True, sal_True );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment