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

support of glossary documents

üst 76bd85b5
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -186,6 +186,7 @@ SwXMLExport::SwXMLExport() :
bExportWholeDoc( bExpWholeDoc ),
bExportFirstTableOnly( bExpFirstTableOnly ),
#endif
bBlock( sal_False ),
bShowProgress( sal_True ),
sNumberFormat(RTL_CONSTASCII_USTRINGPARAM("NumberFormat")),
sCell(RTL_CONSTASCII_USTRINGPARAM("Cell"))
......@@ -217,11 +218,19 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
}
#endif
void SwXMLExport::setBlockMode()
{
bBlock = sal_True;
}
sal_uInt32 SwXMLExport::exportDoc( const sal_Char *pClass )
{
if( !GetModel().is() )
return ERR_SWG_WRITE_ERROR;
GetTextParagraphExport()->SetBlockMode( bBlock );
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -112,6 +112,7 @@ class SwXMLExport : public SvXMLExport
sal_Int32 nContentProgressStart;
sal_Bool bExportWholeDoc : 1;// export whole document?
sal_Bool bBlock : 1; // export text block?
sal_Bool bExportFirstTableOnly : 1;
sal_Bool bShowProgress : 1;
......@@ -175,6 +176,8 @@ public:
#endif
virtual ~SwXMLExport();
void setBlockMode();
virtual sal_uInt32 exportDoc( const sal_Char *pClass=0 );
inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
......@@ -189,6 +192,7 @@ public:
}
sal_Bool IsShowProgress() const { return bShowProgress; }
sal_Bool IsBlockMode() const { return bBlock; }
};
inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -985,7 +985,12 @@ sal_Bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const
bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PSEUDO) != 0;
break;
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;
default:
bIns = SvXMLStylesContext::InsertStyleFamily( nFamily );
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -265,6 +265,7 @@ SvXMLImportContext *SwXMLImport::CreateContext(
SwXMLImport::SwXMLImport() :
bLoadDoc( sal_True ),
bInsert( sal_False ),
bBlock( sal_False ),
nStyleFamilyMask( SFX_STYLE_FAMILY_ALL ),
pDocElemTokenMap( 0 ),
pTableElemTokenMap( 0 ),
......@@ -277,6 +278,8 @@ SwXMLImport::SwXMLImport() :
_InitItemImport();
}
#ifdef XML_CORE_API
SwXMLImport::SwXMLImport(
SwDoc& rDoc, const SwPaM& rPaM,
sal_Bool bLDoc, sal_Bool bInsertMode, sal_uInt16 nStyleFamMask,
......@@ -307,6 +310,7 @@ SwXMLImport::SwXMLImport(
xText->createTextCursorByRange( xTextRange );
GetTextImport()->SetCursor( xTextCursor );
}
#endif
SwXMLImport::~SwXMLImport()
{
......@@ -334,6 +338,12 @@ void SwXMLImport::setStyleInsertMode( sal_uInt16 nFamilies,
bLoadDoc = sal_False;
}
void SwXMLImport::setBlockMode( )
{
bBlock = sal_True;
}
const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() throw()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -110,6 +110,7 @@ class SwXMLImport: public SvXMLImport
// loaded only sal_False means that
// existing styles will be
// overwritten.
sal_Bool bBlock : 1; // Load text block
sal_Bool bAutoStylesValid : 1;
sal_Bool bProgressValid : 1;
sal_Bool bShowProgress : 1;
......@@ -136,6 +137,7 @@ protected:
public:
SwXMLImport();
#ifdef XML_CORE_API
SwXMLImport( SwDoc& rDoc, const SwPaM& rPaM, sal_Bool bLoadDoc,
sal_Bool bInsertMode, sal_uInt16 nStyleFamMask,
const ::com::sun::star::uno::Reference<
......@@ -143,6 +145,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::document::XGraphicObjectResolver > &,
SvStorage *pPkg );
#endif
~SwXMLImport();
......@@ -151,6 +154,7 @@ public:
::com::sun::star::text::XTextRange > & rInsertPos );
void setStyleInsertMode( sal_uInt16 nFamilies,
sal_Bool bOverwrite );
void setBlockMode();
// ::com::sun::star::xml::sax::XDocumentHandler
virtual void SAL_CALL startDocument(void)
......@@ -185,6 +189,7 @@ public:
sal_uInt16 GetStyleFamilyMask() const { return nStyleFamilyMask; }
sal_Bool IsInsertMode() const { return bInsert; }
sal_Bool IsStylesOnlyMode() const { return !bLoadDoc; }
sal_Bool IsBlockMode() const { return bBlock; }
inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
inline const SvXMLImportItemMapper& GetTableItemMapper() const;
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -280,48 +280,51 @@ void SwXMLExport::_ExportMeta()
{
SvXMLExport::_ExportMeta();
OUStringBuffer aOut(16);
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 )
if( !IsBlockMode() )
{
aOut.append( (sal_Int32)aDocStat.nPage );
AddAttribute( XML_NAMESPACE_META, sXML_page_count,
OUStringBuffer aOut(16);
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() );
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