summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2000-11-30 10:30:49 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2000-11-30 10:30:49 +0000
commitb2cfbcab5e04301c0468569bf0c92b632ee7e77a (patch)
tree9fa54ffc1df9d3dc49bde78fdd482e51bd754ac9 /sw
parent6445b484b80d8a9790f1fc0e9911776bd0481d50 (diff)
#80616# remaining API issues needed for XML index im-/export fixed
- added: now TOXMarks always return the same UNO wrapper object, making them comparable - added: SwXDocumentIndexes::GetObject(): converts SwTOXBaseSection into SwXDocumentIndex - added: DocumentIndex-property to SwXTextSection (returns smallest enclosing index) - fixed: XInsertTextContentRelative now disregards IsProtected() flag (like remainder of API) - added: Bibliography now supports ContentSection and HeaderSection properties
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unoidx.hxx5
-rw-r--r--sw/inc/unomap.hxx5
-rw-r--r--sw/source/core/inc/unoclbck.hxx8
-rw-r--r--sw/source/core/unocore/unoclbck.cxx25
-rw-r--r--sw/source/core/unocore/unoidx.cxx15
-rw-r--r--sw/source/core/unocore/unomap.cxx7
-rw-r--r--sw/source/core/unocore/unoobj.cxx27
-rw-r--r--sw/source/core/unocore/unosect.cxx36
-rw-r--r--sw/source/core/unocore/unotext.cxx20
9 files changed, 95 insertions, 53 deletions
diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx
index 29d163429eb6..8871aac8a4e0 100644
--- a/sw/inc/unoidx.hxx
+++ b/sw/inc/unoidx.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoidx.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: os $ $Date: 2000-11-01 15:03:18 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -296,6 +296,7 @@ public:
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
+ static SwXDocumentIndex* GetObject(const SwTOXBaseSection* pTOX);
};
/* -----------------13.09.99 16:39-------------------
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index 68f5995eafbf..efdd035a59aa 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unomap.hxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: os $ $Date: 2000-11-29 11:35:14 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,7 @@
#define WID_SECT_PROTECTED 8006
#define WID_SECT_REGION 8007
#define WID_SECT_DDE_AUTOUPDATE 8008
+#define WID_SECT_DOCUMENT_INDEX 8009
//Verzeichnisse
#define WID_PRIMARY_KEY 1000
diff --git a/sw/source/core/inc/unoclbck.hxx b/sw/source/core/inc/unoclbck.hxx
index ef69639eecf2..7ae5e2524a71 100644
--- a/sw/source/core/inc/unoclbck.hxx
+++ b/sw/source/core/inc/unoclbck.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoclbck.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:08:21 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,9 @@ class SwXReferenceMark;
class SwFmtRefMark;
class SwFmtFtn;
class SwXFootnote;
+class SwTOXMark;
+class SwXDocumentIndexMark;
+
class SwUnoCallBack : public SwModify
{
public:
@@ -81,5 +84,6 @@ public:
// returns the API object of a reference mark if available
SwXReferenceMark* GetRefMark(const SwFmtRefMark& rMark);
SwXFootnote* GetFootnote(const SwFmtFtn& rMark);
+ SwXDocumentIndexMark* GetTOXMark(const SwTOXMark& rMark);
};
#endif
diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx
index a34e201e8688..efb71ae0f1c5 100644
--- a/sw/source/core/unocore/unoclbck.cxx
+++ b/sw/source/core/unocore/unoclbck.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoclbck.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: os $ $Date: 2000-10-16 10:31:05 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -246,8 +246,29 @@ SwXFootnote* SwUnoCallBack::GetFootnote(const SwFmtFtn& rMark)
return 0;
}
+/* -----------------------------27.11.00 17:15--------------------------------
+
+ ---------------------------------------------------------------------------*/
+SwXDocumentIndexMark* SwUnoCallBack::GetTOXMark(const SwTOXMark& rMark)
+{
+ SwClientIter aIter( *this );
+ SwXDocumentIndexMark* pxIndexMark = (SwXDocumentIndexMark*)aIter.First( TYPE( SwXDocumentIndexMark ));
+ while(pxIndexMark)
+ {
+ const SwTOXMark* pMark = pxIndexMark->GetTOXMark();
+ if(pMark == &rMark)
+ return pxIndexMark;
+
+ pxIndexMark = (SwXDocumentIndexMark*)aIter.Next( );
+ }
+ return 0;
+}
+
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
+ Revision 1.2 2000/10/16 10:31:05 os
+ #79422# SwXDocumentIndexMark: invalidation uses SwUnoCallBack
+
Revision 1.1.1.1 2000/09/19 00:08:28 hr
initial import
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index d480e6cf5281..78b40911fe90 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoidx.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: os $ $Date: 2000-11-29 11:41:48 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1984,6 +1984,17 @@ sal_Bool SwXDocumentIndexes::hasElements(void) throw( RuntimeException )
return 0 != getCount();
}
+SwXDocumentIndex* SwXDocumentIndexes::GetObject(const SwTOXBaseSection* pTOX)
+{
+ SwSectionFmt* pFmt = pTOX->GetFmt();
+ SwClientIter aIter(*pFmt);
+ SwXDocumentIndex* pxIdx = (SwXDocumentIndex*)aIter.First(TYPE(SwXDocumentIndex));
+ if(pxIdx)
+ return pxIdx;
+ else
+ return new SwXDocumentIndex(pTOX, pFmt->GetDoc());
+}
+
/* -----------------------------06.04.00 15:08--------------------------------
---------------------------------------------------------------------------*/
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index eff0c8715471..0f79b50dc58b 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unomap.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: os $ $Date: 2000-11-29 17:19:08 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1149,6 +1149,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16
{ SW_PROP_NAME(UNO_NAME_ENDNOTE_NUMBERING_TYPE) ,RES_END_AT_TXTEND, &::getCppuType((const sal_Int16*)0), PROPERTY_NONE ,MID_NUM_TYPE },
{ SW_PROP_NAME(UNO_NAME_ENDNOTE_NUMBERING_PREFIX) ,RES_END_AT_TXTEND, &::getCppuType((const OUString*)0) , PROPERTY_NONE, MID_PREFIX },
{ SW_PROP_NAME(UNO_NAME_ENDNOTE_NUMBERING_SUFFIX) ,RES_END_AT_TXTEND, &::getCppuType((const OUString*)0) , PROPERTY_NONE, MID_SUFFIX },
+ { SW_PROP_NAME(UNO_NAME_DOCUMENT_INDEX), WID_SECT_DOCUMENT_INDEX, &::getCppuType((uno::Reference<text::XDocumentIndex>*)0), PropertyAttribute::READONLY | PropertyAttribute::MAYBEVOID, 0 },
{0,0,0,0}
};
aMapArr[nPropertyId] = aSectionPropertyMap_Impl;
@@ -1746,7 +1747,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16
{
static SfxItemPropertyMap aBibliographyMap_Impl[] =
{
- { SW_PROP_NAME(UNO_NAME_TITLE), WID_IDX_TITLE , &::getCppuType((const OUString*)0) , PROPERTY_NONE, 0},
+ _BASE_INDEX_PROPERTIES_
{ SW_PROP_NAME(UNO_NAME_IS_PROTECTED ), WID_PROTECTED , &::getBooleanCppuType() , PROPERTY_NONE, 0},
{ SW_PROP_NAME(UNO_NAME_TEXT_COLUMNS), RES_COL, &::getCppuType((uno::Reference<text::XTextColumns>*)0), PROPERTY_NONE, MID_COLUMNS},
{ SW_PROP_NAME(UNO_NAME_BACK_GRAPHIC_URL ), RES_BACKGROUND, &::getCppuType((const OUString*)0), PROPERTY_NONE ,MID_GRAPHIC_URL },
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 4290ddd4fc2a..67397f096fc9 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoobj.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: os $ $Date: 2000-11-23 11:45:33 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1268,14 +1268,8 @@ sal_Bool lcl_getCrsrPropertyValue(const SfxItemPropertyMap* pMap
*rPam.Start() );
if( pBase )
{
- SwSectionFmt* pFmt = ((SwTOXBaseSection*)pBase)->GetFmt();
- SwClientIter aIter(*pFmt);
- SwXDocumentIndex* pxIdx = (SwXDocumentIndex*)aIter.First(TYPE(SwXDocumentIndex));
- uno::Reference< XDocumentIndex > aRef;
- if(pxIdx)
- aRef = pxIdx;
- else
- aRef = new SwXDocumentIndex((const SwTOXBaseSection*)pBase, rPam.GetDoc() );
+ uno::Reference< XDocumentIndex > aRef =
+ SwXDocumentIndexes::GetObject((SwTOXBaseSection*)pBase);
rAny.setValue(&aRef, ::getCppuType((uno::Reference<XDocumentIndex>*)0));
}
else
@@ -5629,17 +5623,8 @@ void lcl_InsertTOXMarkPortion(
SwDoc* pDoc = pUnoCrsr->GetDoc();
SwTOXMark& rTOXMark = ((SwTOXMark&)pAttr->GetAttr());
- SwClientIter aIter(*(SwTOXType*)rTOXMark.GetTOXType());
- SwXDocumentIndexMark* pxMark = (SwXDocumentIndexMark*)
- aIter.First(TYPE(SwXDocumentIndexMark));
- while( pxMark )
- {
- if(pxMark->GetTOXMark() == &rTOXMark)
- break;
- pxMark = (SwXDocumentIndexMark*)aIter.Next();
- }
-
- Reference<XTextContent> xContent = pxMark;
+ Reference<XTextContent> xContent =
+ ((SwUnoCallBack*)pDoc->GetUnoCallBack())->GetTOXMark(rTOXMark);
if(!xContent.is())
xContent = new SwXDocumentIndexMark(rTOXMark.GetTOXType(), &rTOXMark, pDoc);
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 69285d64db91..6e549255cb4b 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unosect.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: dvo $ $Date: 2000-11-20 14:00:32 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,6 +118,16 @@
#ifndef _HINTS_HXX //autogen
#include <hints.hxx>
#endif
+#ifndef _TOX_HXX
+#include <tox.hxx>
+#endif
+#ifndef _UNOIDX_HXX
+#include <unoidx.hxx>
+#endif
+#ifndef _DOCTXM_HXX
+#include <doctxm.hxx>
+#endif
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -723,6 +733,28 @@ uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName)
aRet <<= OUString(pFmt->GetSection()->GetName());
}
break;
+ case WID_SECT_DOCUMENT_INDEX:
+ {
+ // search enclosing index
+ SwSection* pEnclosingSection = pSect;
+ while ( (pEnclosingSection != NULL) &&
+ (TOX_CONTENT_SECTION !=
+ pEnclosingSection->GetType()) )
+ {
+ pEnclosingSection = pEnclosingSection->GetParent();
+ }
+ if (pEnclosingSection)
+ {
+ // convert section to TOXBase and get SwXDocumentIndex
+ SwTOXBaseSection* pTOXBaseSect =
+ PTR_CAST(SwTOXBaseSection, pEnclosingSection);
+ Reference<XDocumentIndex> xIndex =
+ SwXDocumentIndexes::GetObject(pTOXBaseSect);
+ aRet <<= xIndex;
+ }
+ // else: no enclosing index found -> empty return value
+ }
+ break;
default:
if(pFmt)
aRet = aPropSet.getPropertyValue(*pMap, pFmt->GetAttrSet());
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 3926b5b84a91..2d6ead1cf82a 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotext.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2000-11-20 14:32:51 $
+ * last change: $Author: dvo $ $Date: 2000-11-30 11:30:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -674,11 +674,7 @@ void SwXText::insertTextContentBefore(
{
SwTable* pTable = SwTable::FindTable( pTableFmt );
SwTableNode* pTblNode = pTable->GetTableNode();
- {
- const SwSectionNode* pSNd = pTblNode->GetSectionNode();
- if( pSNd && pSNd->GetSection().IsProtectFlag() )
- throw RuntimeException();
- }
+
SwNodeIndex aTblIdx( *pTblNode, -1 );
SwPosition aBefore(aTblIdx);
bRet = GetDoc()->AppendTxtNode( aBefore );
@@ -690,8 +686,6 @@ void SwXText::insertTextContentBefore(
{
SwSectionFmt* pSectFmt = pXSection->GetFmt();
SwSectionNode* pSectNode = pSectFmt->GetSectionNode();
- if( pSectNode->GetSection().IsProtectFlag() )
- throw RuntimeException();
SwNodeIndex aSectIdx( *pSectNode, -1 );
SwPosition aBefore(aSectIdx);
@@ -731,12 +725,6 @@ void SwXText::insertTextContentAfter(
SwTable* pTable = SwTable::FindTable( pTableFmt );
SwTableNode* pTblNode = pTable->GetTableNode();
- {
- const SwSectionNode* pSNd = pTblNode->GetSectionNode();
- if( pSNd && pSNd->GetSection().IsProtectFlag() )
- throw RuntimeException();
- }
-
SwEndNode* pTableEnd = pTblNode->EndOfSectionNode();
SwPosition aTableEnd(*pTableEnd);
bRet = GetDoc()->AppendTxtNode( aTableEnd );
@@ -748,8 +736,6 @@ void SwXText::insertTextContentAfter(
{
SwSectionFmt* pSectFmt = pXSection->GetFmt();
SwSectionNode* pSectNode = pSectFmt->GetSectionNode();
- if( pSectNode->GetSection().IsProtectFlag() )
- throw RuntimeException();
SwEndNode* pEnd = pSectNode->EndOfSectionNode();
SwPosition aEnd(*pEnd);
bRet = GetDoc()->AppendTxtNode( aEnd );