summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-01-11 11:40:02 +0000
committerOliver Specht <os@openoffice.org>2001-01-11 11:40:02 +0000
commitacaa3ad09c929a8cc4ad5f8001cfdd509cd81abf (patch)
tree0412747a867855daa2f69581d0a8c61058b605e1 /sw
parent943b477d733e571cad60a3397cbf699472bbb68b (diff)
redline properties at tables and sections
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unomap.cxx20
-rw-r--r--sw/source/core/unocore/unoprnms.cxx8
-rw-r--r--sw/source/core/unocore/unoredline.cxx70
-rw-r--r--sw/source/core/unocore/unosect.cxx30
-rw-r--r--sw/source/core/unocore/unotbl.cxx31
5 files changed, 129 insertions, 30 deletions
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 0b41bd6b0a5b..fa1d304a4081 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.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: dvo $ $Date: 2001-01-10 21:11:42 $
+ * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -496,6 +496,17 @@ void SwUnoPropertyMapProvider::Sort(sal_uInt16 nId)
{ SW_PROP_NAME(UNO_NAME_CHAR_POSTURE_COMPLEX), RES_CHRATR_CTL_POSTURE , &::getCppuType((FontSlant*)0), PropertyAttribute::MAYBEVOID, MID_POSTURE}, \
{ SW_PROP_NAME(UNO_NAME_CHAR_LOCALE_COMPLEX), RES_CHRATR_CTL_LANGUAGE , &::getCppuType((Locale*)0) , PropertyAttribute::MAYBEVOID, MID_LANG_LOCALE },
+#if (defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)) || (defined(__GNUC__) && defined(__APPLE__))
+#define _REDLINE_NODE_PROPERTIES \
+ { SW_PROP_NAME(UNO_NAME_START_REDLINE), FN_UNO_REDLINE_NODE_START, new uno::Type(::getCppuType((Sequence<PropertyValue>*)0)) , PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0xff },\
+ { SW_PROP_NAME(UNO_NAME_END_REDLINE), FN_UNO_REDLINE_NODE_END, new uno::Type(::getCppuType((Sequence<PropertyValue>*)0)) , PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0xff },
+#else
+#define _REDLINE_NODE_PROPERTIES \
+ { SW_PROP_NAME(UNO_NAME_START_REDLINE), FN_UNO_REDLINE_NODE_START , &::getCppuType((Sequence<PropertyValue>*)0) , PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0xff }, \
+ { SW_PROP_NAME(UNO_NAME_END_REDLINE), FN_UNO_REDLINE_NODE_END , &::getCppuType((Sequence<PropertyValue>*)0) , PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0xff },
+#endif
+
+
/* -----------------24.06.98 18:12-------------------
*
* --------------------------------------------------*/
@@ -1075,6 +1086,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16
{ SW_PROP_NAME(UNO_LINK_DISPLAY_NAME), FN_PARAM_LINK_DISPLAY_NAME, &::getCppuType((const OUString*)0), PropertyAttribute::READONLY, 0xff},
{ SW_PROP_NAME(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, &::getCppuType((uno::Reference<container::XNameContainer>*)0), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NAME(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, &::getCppuType((uno::Reference<text::XTextSection>*)0), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },
+ _REDLINE_NODE_PROPERTIES
{0,0}
};
@@ -1220,6 +1232,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16
{ 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 },
COMMON_TEXT_CONTENT_PROPERTIES
+ _REDLINE_NODE_PROPERTIES
{0,0,0,0}
};
aMapArr[nPropertyId] = aSectionPropertyMap_Impl;
@@ -1246,9 +1259,6 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16
aMapArr[nPropertyId] = aSearchPropertyMap_Impl;
}
break;
-
-
-
case PROPERTY_MAP_TEXT_FRAME:
{
static SfxItemPropertyMap aFramePropertyMap_Impl[] =
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 5def4e53b314..98e7dd36533e 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoprnms.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: dvo $ $Date: 2001-01-10 21:11:42 $
+ * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -637,3 +637,7 @@ const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_COMMENT (MAP
const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_TYPE (MAP_CHAR_LEN("RedlineType"));
const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_SUCCESSOR_DATA (MAP_CHAR_LEN("RedlineSuccessorData"));
const SwPropNameLen __FAR_DATA UNO_NAME_REDLINE_IDENTIFIER (MAP_CHAR_LEN("RedlineIdentifier"));
+
+const SwPropNameLen __FAR_DATA UNO_NAME_START_REDLINE (MAP_CHAR_LEN("StartRedline"));
+const SwPropNameLen __FAR_DATA UNO_NAME_END_REDLINE (MAP_CHAR_LEN("EndRedline"));
+
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 5fff233ea34b..a4aaf1041e63 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoredline.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dvo $ $Date: 2001-01-10 21:11:42 $
+ * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -307,6 +307,28 @@ OUString lcl_RedlineTypeToOUString(SwRedlineType eType)
return sRet;
}
// ---------------------------------------------------------------------------
+Sequence<PropertyValue> lcl_GetSuccessorProperties(const SwRedline& rRedline)
+{
+ Sequence<PropertyValue> aValues(4);
+
+ const SwRedlineData* pNext = rRedline.GetRedlineData().Next();
+ if(pNext)
+ {
+ PropertyValue* pValues = aValues.getArray();
+ pValues[0].Name = C2U(UNO_NAME_REDLINE_AUTHOR);
+ // GetAuthorString(n) walks the SwRedlineData* chain;
+ // here we always need element 1
+ pValues[0].Value <<= OUString(rRedline.GetAuthorString(1));
+ pValues[1].Name = C2U(UNO_NAME_REDLINE_DATE_TIME);
+ pValues[1].Value <<= lcl_DateTimeToUno(pNext->GetTimeStamp());
+ pValues[2].Name = C2U(UNO_NAME_REDLINE_COMMENT);
+ pValues[2].Value <<= OUString(pNext->GetComment());
+ pValues[3].Name = C2U(UNO_NAME_REDLINE_TYPE);
+ pValues[3].Value <<= lcl_RedlineTypeToOUString(pNext->GetType());
+ }
+ return aValues;
+}
+// ---------------------------------------------------------------------------
Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
@@ -329,23 +351,8 @@ Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
}
else if(rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_SUCCESSOR_DATA.pName, UNO_NAME_REDLINE_SUCCESSOR_DATA.nNameLen))
{
- const SwRedlineData* pNext = pRedline->GetRedlineData().Next();
- if(pNext)
- {
- Sequence<PropertyValue> aValues(4);
- PropertyValue* pValues = aValues.getArray();
- pValues[0].Name = C2U(UNO_NAME_REDLINE_AUTHOR);
- // GetAuthorString(n) walks the SwRedlineData* chain;
- // here we always need element 1
- pValues[0].Value <<= OUString(pRedline->GetAuthorString(1));
- pValues[1].Name = C2U(UNO_NAME_REDLINE_DATE_TIME);
- pValues[1].Value <<= lcl_DateTimeToUno(pNext->GetTimeStamp());
- pValues[2].Name = C2U(UNO_NAME_REDLINE_COMMENT);
- pValues[2].Value <<= OUString(pNext->GetComment());
- pValues[3].Name = C2U(UNO_NAME_REDLINE_TYPE);
- pValues[3].Value <<= lcl_RedlineTypeToOUString(pNext->GetType());
- aRet <<= aValues;
- }
+ if(pRedline->GetRedlineData().Next())
+ aRet <<= lcl_GetSuccessorProperties(*pRedline);
}
else if (rPropertyName.equalsAsciiL(UNO_NAME_REDLINE_IDENTIFIER.pName,
UNO_NAME_REDLINE_IDENTIFIER.nNameLen))
@@ -435,4 +442,29 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) th
rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
return aId;
}
+/* -----------------------------11.01.01 11:22--------------------------------
+
+ ---------------------------------------------------------------------------*/
+Sequence< PropertyValue > SwXRedlinePortion::CreateRedlineProperties( const SwRedline& rRedline ) throw()
+{
+ Sequence< PropertyValue > aRet;
+ const SwRedlineData* pNext = rRedline.GetRedlineData().Next();
+ aRet.realloc( pNext ? 5 : 4 );
+ PropertyValue* pRet = aRet.getArray();
+
+ pRet[0].Name = C2U(UNO_NAME_REDLINE_AUTHOR.pName);
+ pRet[0].Value <<= OUString(rRedline.GetAuthorString());
+ pRet[1].Name = C2U(UNO_NAME_REDLINE_DATE_TIME.pName);
+ pRet[1].Value <<= lcl_DateTimeToUno(rRedline.GetTimeStamp());
+ pRet[2].Name = C2U(UNO_NAME_REDLINE_COMMENT .pName);
+ pRet[2].Value <<= OUString(rRedline.GetComment());
+ pRet[3].Name = C2U(UNO_NAME_REDLINE_TYPE .pName);
+ pRet[3].Value <<= lcl_RedlineTypeToOUString(rRedline.GetType());
+ if(pNext)
+ {
+ pRet[4].Name = C2U(UNO_NAME_REDLINE_SUCCESSOR_DATA.pName);
+ pRet[4].Value <<= lcl_GetSuccessorProperties(rRedline);
+ }
+ return aRet;
+}
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 907fd9144585..4c6807a85838 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.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: os $ $Date: 2000-12-09 15:37:44 $
+ * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,6 +97,12 @@
#ifndef _UNOOBJ_HXX
#include <unoobj.hxx>
#endif
+#ifndef _UNOREDLINE_HXX
+#include <unoredline.hxx>
+#endif
+#ifndef _REDLINE_HXX
+#include <redline.hxx>
+#endif
#ifndef _UNOMAP_HXX
#include <unomap.hxx>
#endif
@@ -793,6 +799,26 @@ uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName)
case FN_UNO_ANCHOR_TYPE:
SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pMap->nWID);
break;
+ case FN_UNO_REDLINE_NODE_START:
+ case FN_UNO_REDLINE_NODE_END:
+ {
+ SwNode* pSectNode = pFmt->GetSectionNode();
+ if(FN_UNO_REDLINE_NODE_END == pMap->nWID)
+ pSectNode = pSectNode->EndOfSectionNode();
+ const SwRedlineTbl& rRedTbl = pFmt->GetDoc()->GetRedlineTbl();
+ for(USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++)
+ {
+ const SwRedline* pRedline = rRedTbl[nRed];
+ const SwNode* pRedPointNode = pRedline->GetNode(TRUE);
+ const SwNode* pRedMarkNode = pRedline->GetNode(FALSE);
+ if(pRedPointNode == pSectNode || pRedMarkNode == pSectNode)
+ {
+ aRet <<= SwXRedlinePortion::CreateRedlineProperties(*pRedline);
+ break;
+ }
+ }
+ }
+ break;
default:
if(pFmt)
aRet = aPropSet.getPropertyValue(*pMap, pFmt->GetAttrSet());
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 30a9b4556eb6..75314290f5e5 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotbl.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: os $ $Date: 2000-12-15 14:35:14 $
+ * last change: $Author: os $ $Date: 2001-01-11 12:40:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -142,9 +142,15 @@
#ifndef _TABFRM_HXX //autogen
#include <tabfrm.hxx>
#endif
+#ifndef _REDLINE_HXX
+#include <redline.hxx>
+#endif
#ifndef _UNOMAP_HXX
#include <unomap.hxx>
#endif
+#ifndef _UNOREDLINE_HXX
+#include <unoredline.hxx>
+#endif
#ifndef _SCH_DLL_HXX
#include <sch/schdll.hxx>
#endif
@@ -418,6 +424,27 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertyMap* pMap )
case FN_PARAM_LINK_DISPLAY_NAME :
aRet <<= OUString(pFmt->GetName());
break;
+ case FN_UNO_REDLINE_NODE_START:
+ case FN_UNO_REDLINE_NODE_END:
+ {
+ SwTable* pTable = SwTable::FindTable( pFmt );
+ SwNode* pTblNode = pTable->GetTableNode();
+ if(FN_UNO_REDLINE_NODE_END == pMap->nWID)
+ pTblNode = pTblNode->EndOfSectionNode();
+ const SwRedlineTbl& rRedTbl = pFmt->GetDoc()->GetRedlineTbl();
+ for(USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++)
+ {
+ const SwRedline* pRedline = rRedTbl[nRed];
+ const SwNode* pRedPointNode = pRedline->GetNode(TRUE);
+ const SwNode* pRedMarkNode = pRedline->GetNode(FALSE);
+ if(pRedPointNode == pTblNode || pRedMarkNode == pTblNode)
+ {
+ aRet <<= SwXRedlinePortion::CreateRedlineProperties(*pRedline);
+ break;
+ }
+ }
+ }
+ break;
}
return aRet;
}