From a6c2c1698f9ec38563a0246ddc8d4003c3f4147a Mon Sep 17 00:00:00 2001 From: Oliver Specht Date: Thu, 26 Oct 2000 09:02:20 +0000 Subject: properties added to the SwXTextCursor: IsSkipHidden/ProtectedText --- sw/inc/cmdid.h | 7 ++++-- sw/inc/unoprnms.hxx | 6 +++-- sw/source/core/unocore/unoobj.cxx | 47 +++++++++++++++++++++++++++++++++---- sw/source/core/unocore/unoprnms.cxx | 6 +++-- 4 files changed, 55 insertions(+), 11 deletions(-) diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index e80d40300ff5..81bad6797c44 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -2,9 +2,9 @@ * * $RCSfile: cmdid.h,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-10-24 14:25:39 $ + * last change: $Author: os $ $Date: 2000-10-26 10:00:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -865,6 +865,9 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr #define FN_UNO_IS_NUMBER (FN_EXTRA2 + 69) #define FN_UNO_TEXT_WRAP (FN_EXTRA2 + 70) #define FN_UNO_ANCHOR_TYPE (FN_EXTRA2 + 71) +#define FN_SKIP_HIDDEN_TEXT (FN_EXTRA2 + 72) +#define FN_SKIP_PROTECTED_TEXT (FN_EXTRA2 + 73) + /*-------------------------------------------------------------------- Bereich: Fenster --------------------------------------------------------------------*/ diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index b5b133af3935..0e8fc2d6f119 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unoprnms.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: os $ $Date: 2000-10-25 12:49:28 $ + * last change: $Author: os $ $Date: 2000-10-26 10:00:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -553,6 +553,8 @@ extern const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_COLOR; extern const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT; extern const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT; extern const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_IS_ON; +extern const SwPropNameLen __FAR_DATA UNO_NAME_IS_SKIP_HIDDEN_TEXT; +extern const SwPropNameLen __FAR_DATA UNO_NAME_IS_SKIP_PROTECTED_TEXT; #endif diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 633e76793552..9fbbb640c453 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.13 $ + * $Revision: 1.14 $ * - * last change: $Author: os $ $Date: 2000-10-25 11:46:21 $ + * last change: $Author: os $ $Date: 2000-10-26 10:02:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2781,7 +2781,22 @@ Any SwXTextCursor::GetPropertyDefault( -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextCursor::getPropertySetInfo(void) throw( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySetInfo > xRef = aPropSet.getPropertySetInfo(); + static uno::Reference< beans::XPropertySetInfo > xRef; + if(!xRef.is()) + { + static SfxItemPropertyMap aCrsrExtMap_Impl[] = + { + { SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT), FN_SKIP_HIDDEN_TEXT, &::getBooleanCppuType(), PROPERTY_NONE, 0}, + { SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT), FN_SKIP_PROTECTED_TEXT, &::getBooleanCppuType(), PROPERTY_NONE, 0}, + {0,0,0,0} + }; + uno::Reference< beans::XPropertySetInfo > xInfo = aPropSet.getPropertySetInfo(); + // PropertySetInfo verlaengern! + const uno::Sequence aPropSeq = xInfo->getProperties(); + xRef = new SfxExtItemPropertySetInfo( + aCrsrExtMap_Impl, + aPropSeq ); + } return xRef; } /*-- 09.12.98 14:18:54--------------------------------------------------- @@ -2796,7 +2811,18 @@ void SwXTextCursor::setPropertyValue(const OUString& rPropertyName, const uno::A SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName, aValue); + if(!rPropertyName.compareToAscii(UNO_NAME_IS_SKIP_HIDDEN_TEXT.pName)) + { + sal_Bool bSet = *(sal_Bool*)aValue.getValue(); + pUnoCrsr->SetSkipOverHiddenSections(bSet); + } + else if(!rPropertyName.compareToAscii(UNO_NAME_IS_SKIP_PROTECTED_TEXT.pName)) + { + sal_Bool bSet = *(sal_Bool*)aValue.getValue(); + pUnoCrsr->SetSkipOverProtectSections(bSet); + } + else + SetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName, aValue); } else throw uno::RuntimeException(); @@ -2813,7 +2839,18 @@ Any SwXTextCursor::getPropertyValue(const OUString& rPropertyName) SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - aAny = GetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName); + if(!rPropertyName.compareToAscii(UNO_NAME_IS_SKIP_HIDDEN_TEXT.pName)) + { + BOOL bSet = pUnoCrsr->IsSkipOverHiddenSections(); + aAny.setValue(&bSet, ::getBooleanCppuType()); + } + else if(!rPropertyName.compareToAscii(UNO_NAME_IS_SKIP_PROTECTED_TEXT.pName)) + { + BOOL bSet = pUnoCrsr->IsSkipOverProtectSections(); + aAny.setValue(&bSet, ::getBooleanCppuType()); + } + else + aAny = GetPropertyValue(*pUnoCrsr, aPropSet, rPropertyName); } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index 15e664d0e1a2..0d1d20fcda54 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.9 $ + * $Revision: 1.10 $ * - * last change: $Author: os $ $Date: 2000-10-25 12:59:42 $ + * last change: $Author: os $ $Date: 2000-10-26 10:02:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -551,4 +551,6 @@ const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_COLOR const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT (MAP_CHAR_LEN("SeparatorLineRelativeHeight")); const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT (MAP_CHAR_LEN("SeparatorLineVerticalAlignment")); const SwPropNameLen __FAR_DATA UNO_NAME_SEPARATOR_LINE_IS_ON (MAP_CHAR_LEN("SeparatorLineIsOn")); +const SwPropNameLen __FAR_DATA UNO_NAME_IS_SKIP_HIDDEN_TEXT (MAP_CHAR_LEN("IsSkipHiddenText")); +const SwPropNameLen __FAR_DATA UNO_NAME_IS_SKIP_PROTECTED_TEXT (MAP_CHAR_LEN("IsSkipProtectedText")); -- cgit v1.2.3