summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brauer <mib@openoffice.org>2001-01-18 11:39:02 +0000
committerMichael Brauer <mib@openoffice.org>2001-01-18 11:39:02 +0000
commit241bc767a7828db202c55df36da5aeca1e4bc997 (patch)
tree268080d8c29bbd03ca2d2776665b528e781d3baf
parent76bd85b50ed015d852597ad67ed75032a410115e (diff)
support of glossary documents
-rw-r--r--sw/source/filter/xml/xmlexp.cxx13
-rw-r--r--sw/source/filter/xml/xmlexp.hxx8
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx11
-rw-r--r--sw/source/filter/xml/xmlimp.cxx14
-rw-r--r--sw/source/filter/xml/xmlimp.hxx9
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx87
6 files changed, 89 insertions, 53 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 9aaab3743f18..ba96d84e67c3 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -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);
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index b105c6565fde..4908b7634585 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -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
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 0d69173369ad..67159aa15797 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -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 );
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e636d3392072..0d8186cc6ecc 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -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();
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index 2e01b59eac66..e3f6f49c1465 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -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;
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index b7df24cdf47e..3bc4e8e6523a 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -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 );
}