summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svl/source/items/itemset.cxx195
-rw-r--r--svl/source/items/nranges.cxx173
-rw-r--r--svl/source/items/style.cxx83
3 files changed, 201 insertions, 250 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 33ed2d49b03e..3050442491a7 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -35,9 +35,9 @@
// STATIC DATA -----------------------------------------------------------
-static const sal_uInt16 nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0'
+static const sal_uInt16 nInitCount = 10; // Single USHORTs => 5 pairs without '0'
#if OSL_DEBUG_LEVEL > 1
-static sal_uLong nRangesCopyCount = 0; // wie oft wurden Ranges kopiert
+static sal_uLong nRangesCopyCount = 0; // How often have ranges been copied?
#endif
#include "nranges.cxx"
@@ -75,32 +75,24 @@ const sal_Char *DbgCheckItemSet( const void* pVoid )
#endif
-
+/**
+ * Ctor for a SfxItemSet with exactly the Which Ranges, which are known to
+ * the supplied SfxItemPool.
+ *
+ * For Sfx programmers: an SfxItemSet constructed in this way cannot
+ * contain any Items with SlotIds as Which values.
+ */
SfxItemSet::SfxItemSet
(
- SfxItemPool& rPool, /* der Pool, in dem die SfxPoolItems,
- welche in dieses SfxItemSet gelangen,
- aufgenommen werden sollen */
- bool bTotalRanges /* komplette Pool-Ranges uebernehmen,
- muss auf sal_True gesetzt werden */
+ SfxItemPool& rPool, /* Target Pool for the SfxPoolItems which are
+ added to this SfxItemSet */
+ bool bTotalRanges /* Take over complete pool ranges? */
)
-/* [Beschreibung]
-
- Konstruktor fuer ein SfxItemSet mit genau den Which-Bereichen, welche
- dem angegebenen <SfxItemPool> bekannt sind.
-
-
- [Anmerkung]
-
- F"ur Sfx-Programmierer ein derart konstruiertes SfxItemSet kann
- keinerlei Items mit Slot-Ids als Which-Werte aufnehmen!
-*/
-
: _pPool( &rPool ),
_pParent( 0 ),
_nCount( 0 )
{
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
+ DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
DBG( _pChildCountCtor; *_pChildCount(this) = 0 );
// DBG_ASSERT( bTotalRanges || abs( &bTotalRanges - this ) < 1000,
// "please use suitable ranges" );
@@ -128,8 +120,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhic
_pParent( 0 ),
_nCount( 0 )
{
- DBG_ASSERT( nWhich1 <= nWhich2, "Ungueltiger Bereich" );
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
+ DBG_ASSERT( nWhich1 <= nWhich2, "Invalid range" );
+ DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
DBG( _pChildCountCtor; *_pChildCount(this) = 0 );
InitRanges_Impl(nWhich1, nWhich2);
@@ -166,8 +158,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool,
_pWhichRanges( 0 ),
_nCount( 0 )
{
- DBG_ASSERT( nWh1 <= nWh2, "Ungueltiger Bereich" );
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
+ DBG_ASSERT( nWh1 <= nWh2, "Invalid range" );
+ DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
DBG( _pChildCountCtor; *_pChildCount(this) = 0 );
if(!nNull)
@@ -219,7 +211,7 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable )
, _pWhichRanges(0)
, _nCount(0)
{
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
+ DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
DBG( _pChildCountCtor; *_pChildCount(this) = 0 );
// pWhichPairTable == 0 ist f"ur das SfxAllEnumItemSet
@@ -232,11 +224,11 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
_pParent( rASet._pParent ),
_nCount( rASet._nCount )
{
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
+ DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
DBG( _pChildCountCtor; *_pChildCount(this) = 0 );
DBG( ++*_pChildCount(_pParent) );
- // errechne die Anzahl von Attributen
+ // Calculate the attribute count
sal_uInt16 nCnt = 0;
sal_uInt16* pPtr = rASet._pWhichRanges;
while( *pPtr )
@@ -247,27 +239,27 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
_aItems = new const SfxPoolItem* [ nCnt ];
- // Attribute kopieren
+ // Copy attributes
SfxItemArray ppDst = _aItems, ppSrc = rASet._aItems;
for( sal_uInt16 n = nCnt; n; --n, ++ppDst, ++ppSrc )
- if ( 0 == *ppSrc || // aktueller Default?
- IsInvalidItem(*ppSrc) || // Dont Care?
- IsStaticDefaultItem(*ppSrc) ) // nicht zu poolende Defaults
- // einfach Pointer kopieren
+ if ( 0 == *ppSrc || // Current Default?
+ IsInvalidItem(*ppSrc) || // DontCare?
+ IsStaticDefaultItem(*ppSrc) ) // Defaults that are not to be pooled?
+ // Just copy the pointer
*ppDst = *ppSrc;
else if ( _pPool->IsItemFlag( **ppSrc, SFX_ITEM_POOLABLE ) )
{
- // einfach Pointer kopieren und Ref-Count erh"ohen
+ // Just copy the pointer and increase RefCount
*ppDst = *ppSrc;
( (SfxPoolItem*) (*ppDst) )->AddRef();
}
else if ( !(*ppSrc)->Which() )
*ppDst = (*ppSrc)->Clone();
else
- // !IsPoolable() => via Pool zuweisen
+ // !IsPoolable() => assign via Pool
*ppDst = &_pPool->Put( **ppSrc );
- // dann noch die Which Ranges kopieren
+ // Copy the WhichRanges
#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount);
#endif
@@ -294,13 +286,12 @@ SfxItemSet::~SfxItemSet()
if( !(*ppFnd)->Which() )
delete (SfxPoolItem*) *ppFnd;
else {
- // noch mehrer Referenzen vorhanden, also nur den
- // ReferenzCounter manipulieren
+ // Still multiple references present, so just alter the RefCount
if ( 1 < (*ppFnd)->GetRefCount() && !IsDefaultItem(*ppFnd) )
(*ppFnd)->ReleaseRef();
else
if ( !IsDefaultItem(*ppFnd) )
- // aus dem Pool loeschen
+ // Delete from Pool
_pPool->Remove( **ppFnd );
}
}
@@ -317,11 +308,10 @@ SfxItemSet::~SfxItemSet()
}
-
+/**
+ * Delete single Items or all Items (nWhich == 0)
+ */
sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
-
-// einzelnes Item oder alle Items (nWhich==0) l"oschen
-
{
if( !Count() )
return 0;
@@ -334,14 +324,14 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
const sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
- // in diesem Bereich?
+ // Within this range?
if( *pPtr <= nWhich && nWhich <= *(pPtr+1) )
{
- // "uberhaupt gesetzt?
+ // Actually set?
ppFnd += nWhich - *pPtr;
if( *ppFnd )
{
- // wegen der Assertions ins Sub-Calls mu\s das hier sein
+ // Due to the assertions in the sub calls, we need to do the following
--_nCount;
const SfxPoolItem *pItemToClear = *ppFnd;
*ppFnd = 0;
@@ -362,7 +352,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
++nDel;
}
- // gefunden => raus
+ // found => break
break;
}
ppFnd += *(pPtr+1) - *pPtr + 1;
@@ -379,7 +369,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
for( nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
if( *ppFnd )
{
- // wegen der Assertions ins Sub-Calls mu\s das hier sein
+ // Due to the assertions in the sub calls, we need to do this
--_nCount;
const SfxPoolItem *pItemToClear = *ppFnd;
*ppFnd = 0;
@@ -461,7 +451,7 @@ void SfxItemSet::InvalidateDefaultItems()
void SfxItemSet::InvalidateAllItems()
{
- DBG_ASSERT( !_nCount, "Es sind noch Items gesetzt" );
+ DBG_ASSERT( !_nCount, "There are still Items set" );
memset( (void*)_aItems, -1, ( _nCount = TotalCount() ) * sizeof( SfxPoolItem*) );
}
@@ -472,7 +462,7 @@ SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
bool bSrchInParent,
const SfxPoolItem **ppItem ) const
{
- // suche den Bereich in dem das Which steht:
+ // Find the range in which the Which is located
const SfxItemSet* pAktSet = this;
SfxItemState eRet = SFX_ITEM_UNKNOWN;
do
@@ -485,18 +475,18 @@ SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
{
if ( *pPtr <= nWhich && nWhich <= *(pPtr+1) )
{
- // in diesem Bereich
+ // Within this range
ppFnd += nWhich - *pPtr;
if ( !*ppFnd )
{
eRet = SFX_ITEM_DEFAULT;
if( !bSrchInParent )
- return eRet; // nicht vorhanden
- break; // JP: in den Parents weitersuchen !!!
+ return eRet; // Not present
+ break; // Keep searching in the parents!
}
if ( (SfxPoolItem*) -1 == *ppFnd )
- // Unterschiedlich vorhanden
+ // Different ones are present
return SFX_ITEM_DONTCARE;
if ( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
@@ -538,29 +528,30 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
0 != &((const SfxSetItem&)rItem).GetItemSet(),
"SetItem without ItemSet" );
if ( !nWhich )
- return 0; //! nur wegen Outliner-Bug
+ return 0; //FIXME: Only because of Outliner bug
+
SfxItemArray ppFnd = _aItems;
const sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
if( *pPtr <= nWhich && nWhich <= *(pPtr+1) )
{
- // in diesem Bereich
+ // Within this range
ppFnd += nWhich - *pPtr;
- if( *ppFnd ) // schon einer vorhanden
+ if( *ppFnd ) // Already one present
{
- // selbes Item bereits vorhanden?
+ // Same Item already present?
if ( *ppFnd == &rItem )
return 0;
- // wird dontcare oder disabled mit was echtem ueberschrieben?
+ // Will 'dontcare' or 'disabled' be overwritten with some real value?
if ( rItem.Which() && ( IsInvalidItem(*ppFnd) || !(*ppFnd)->Which() ) )
{
*ppFnd = &_pPool->Put( rItem, nWhich );
return *ppFnd;
}
- // wird disabled?
+ // Turns into disabled?
if( !rItem.Which() )
{
*ppFnd = rItem.Clone(_pPool);
@@ -568,11 +559,11 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
}
else
{
- // selber Wert bereits vorhanden?
+ // Same value already present?
if ( rItem == **ppFnd )
return 0;
- // den neuen eintragen, den alten austragen
+ // Add the new one, remove the old one
const SfxPoolItem& rNew = _pPool->Put( rItem, nWhich );
const SfxPoolItem* pOld = *ppFnd;
*ppFnd = &rNew;
@@ -627,7 +618,7 @@ bool SfxItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault )
{
if ( bInvalidAsDefault )
bRet |= 0 != ClearItem( nWhich );
- // gab GPF bei non.WIDs:
+ // FIXME: Caused a SEGFAULT on non Windows-platforms:
// bRet |= 0 != Put( rSet.GetPool()->GetDefaultItem(nWhich), nWhich );
else
InvalidateItem( nWhich );
@@ -642,31 +633,27 @@ bool SfxItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault )
}
-
+/**
+ * This method takes the Items from the 'rSet' and adds to '*this'.
+ * Which ranges in '*this' that are non-existent in 'rSet' will not
+ * be altered. The Which range of '*this' is also not changed.
+ *
+ * Items set in 'rSet' are also set in '*this'.
+ * Default (0 pointer) and Invalid (-1 pointer) Items are processed
+ * according to their parameter 'eDontCareAs' and 'eDefaultAs':
+ *
+ * SFX_ITEM_SET: Hard set to the default of the Pool
+ * SFX_ITEM_DEFAULT: Deleted (0 pointer)
+ * SFX_ITEM_DONTCARE: Invalid (-1 pointer)
+ *
+ * NB: All other values for 'eDontCareAs' and 'eDefaultAs' are invalid
+ */
void SfxItemSet::PutExtended
(
- const SfxItemSet& rSet, // Quelle der zu puttenden Items
- SfxItemState eDontCareAs, // was mit DontCare-Items passiert
- SfxItemState eDefaultAs // was mit Default-Items passiert
+ const SfxItemSet& rSet, // Source of the Items to be put
+ SfxItemState eDontCareAs, // What will happen to the DontCare Items
+ SfxItemState eDefaultAs // What will happen to the Default Items
)
-
-/* [Beschreibung]
-
- Diese Methode "ubernimmt die Items aus 'rSet' in '*this'. Die
- Which-Bereiche in '*this', die in 'rSet' nicht vorkommen bleiben unver-
- "andert. Der Which-Bereich von '*this' bleibt auch unver"andert.
-
- In 'rSet' gesetzte Items werden auch in '*this*' gesetzt. Default-
- (0 Pointer) und Invalid- (-1 Pointer) Items werden je nach Parameter
- ('eDontCareAs' und 'eDefaultAs' behandelt:
-
- SFX_ITEM_SET: hart auf Default des Pools gesetzt
- SFX_ITEM_DEFAULT: gel"oscht (0 Pointer)
- SFX_ITEM_DONTCARE: invalidiert (-1 Pointer)
-
- Alle anderen Werte f"ur 'eDontCareAs' und 'eDefaultAs' sind ung"ultig.
-*/
-
{
// don't "optimize" with "if( rSet.Count()" because of dont-care + defaults
SfxItemArray ppFnd = rSet._aItems;
@@ -698,12 +685,12 @@ void SfxItemSet::PutExtended
}
}
else
- // Item ist gesetzt:
+ // Item is set:
Put( **ppFnd, nWhich );
}
else
{
- // Item ist Default:
+ // Item is default:
switch ( eDefaultAs )
{
case SFX_ITEM_SET:
@@ -727,14 +714,11 @@ void SfxItemSet::PutExtended
}
-
+/**
+ * Expands the ranges of settable items by 'nFrom' to 'nTo'. Keeps state of
+ * items which are new ranges too.
+ */
void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo )
-/** <H3>Description</H3>
-
- Expands the ranges of settable items by 'nFrom' to 'nTo'. Keeps state of
- items which are new ranges too.
-*/
-
{
// special case: exactly one sal_uInt16 which is already included?
SfxItemState eItemState = GetItemState(nFrom, false);
@@ -748,17 +732,13 @@ void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo )
}
-
+/**
+ * Modifies the ranges of settable items. Keeps state of items which
+ * are new ranges too.
+ */
void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges )
-
-/** <H3>Description</H3>
-
- Modifies the ranges of settable items. Keeps state of items which
- are new ranges too.
-*/
-
{
- // identische Ranges?
+ // Identical Ranges?
if ( _pWhichRanges == pNewRanges )
return;
const sal_uInt16* pOld = _pWhichRanges;
@@ -844,10 +824,11 @@ void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges )
bool SfxItemSet::Set
(
- const SfxItemSet& rSet, /* das SfxItemSet, dessen SfxPoolItems
- "ubernommen werden sollen */
+ const SfxItemSet& rSet, /* The SfxItemSet, whose SfxPoolItems are
+ to been taken over */
bool bDeep /* true (default)
+
auch die SfxPoolItems aus den ggf. an
rSet vorhandenen Parents werden direkt
in das SfxItemSet "ubernommen
@@ -857,7 +838,7 @@ bool SfxItemSet::Set
rSet werden nicht ber"ucksichtigt */
)
-/* [Beschreibung]
+/**
Das SfxItemSet nimmt genau die SfxPoolItems an, die auch in
rSet gesetzt sind und im eigenen <Which-Bereich> liegen. Alle
@@ -1472,7 +1453,7 @@ SvStream &SfxItemSet::Store
{
DBG_ASSERT( _pPool, "Kein Pool" );
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
+ DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
// Position des Counts merken, um ggf. zu korrigieren
sal_uLong nCountPos = rStream.Tell();
diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx
index 13d58b02df57..ce32bdc68e8f 100644
--- a/svl/source/items/nranges.cxx
+++ b/svl/source/items/nranges.cxx
@@ -45,26 +45,22 @@ inline void Swap_Impl(const sal_uInt16 *& rp1, const sal_uInt16 *& rp2)
rp2 = pTemp;
}
-
+/**
+ * Creates a sal_uInt16-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as
+ * first range, 'nNull' as terminator or start of 2nd range and 'pArgs' as
+ * remainder.
+ *
+ * It returns the number of sal_uInt16s which are contained in the described
+ * set of sal_uInt16s.
+ */
sal_uInt16 InitializeRanges_Impl( sal_uInt16 *&rpRanges, va_list pArgs,
sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull )
-
-/** <H3>Description</H3>
-
- Creates an sal_uInt16-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as
- first range, 'nNull' as terminator or start of 2nd range and 'pArgs' as
- remaider.
-
- It returns the number of sal_uInt16s which are contained in the described
- set of sal_uInt16s.
-*/
-
{
sal_uInt16 nSize = 0, nIns = 0;
std::vector<sal_uInt16> aNumArr;
aNumArr.push_back( nWh1 );
aNumArr.push_back( nWh2 );
- DBG_ASSERT( nWh1 <= nWh2, "Ungueltiger Bereich" );
+ DBG_ASSERT( nWh1 <= nWh2, "Invalid range" );
nSize += nWh2 - nWh1 + 1;
aNumArr.push_back( nNull );
bool bEndOfRange = false;
@@ -77,15 +73,15 @@ sal_uInt16 InitializeRanges_Impl( sal_uInt16 *&rpRanges, va_list pArgs,
if ( bEndOfRange )
{
const sal_uInt16 nPrev(*aNumArr.rbegin());
- DBG_ASSERT( nPrev <= nIns, "Ungueltiger Bereich" );
+ DBG_ASSERT( nPrev <= nIns, "Invalid range" );
nSize += nIns - nPrev + 1;
}
aNumArr.push_back( nIns );
}
- assert( bEndOfRange ); // odd number of Which-IDs
+ assert( bEndOfRange ); // odd number of WhichIds
- // so, jetzt sind alle Bereiche vorhanden und
+ // Now all ranges are present
rpRanges = new sal_uInt16[ aNumArr.size() + 1 ];
std::copy( aNumArr.begin(), aNumArr.end(), rpRanges);
*(rpRanges + aNumArr.size()) = 0;
@@ -93,15 +89,12 @@ sal_uInt16 InitializeRanges_Impl( sal_uInt16 *&rpRanges, va_list pArgs,
return nSize;
}
-
+/**
+ * Determines the number of sal_uInt16s in a 0-terminated array of pairs of
+ * sal_uInt16s.
+ * The terminating 0 is not included in the count.
+ */
sal_uInt16 Count_Impl( const sal_uInt16 *pRanges )
-
-/** <H3>Description</H3>
-
- Determines the number of sal_uInt16s in an 0-terminated array of pairs of
- sal_uInt16s. The terminating 0 is not included in the count.
-*/
-
{
sal_uInt16 nCount = 0;
while ( *pRanges )
@@ -112,15 +105,11 @@ sal_uInt16 Count_Impl( const sal_uInt16 *pRanges )
return nCount;
}
-
+/**
+ * Determines the total number of sal_uInt16s described in a 0-terminated
+ * array of pairs of sal_uInt16s, each representing an range of sal_uInt16s.
+ */
sal_uInt16 Capacity_Impl( const sal_uInt16 *pRanges )
-
-/** <H3>Description</H3>
-
- Determines the total number of sal_uInt16s described in an 0-terminated
- array of pairs of sal_uInt16s, each representing an range of sal_uInt16s.
-*/
-
{
sal_uInt16 nCount = 0;
@@ -135,14 +124,10 @@ sal_uInt16 Capacity_Impl( const sal_uInt16 *pRanges )
return nCount;
}
-
+/**
+ * Copy ctor
+ */
SfxUShortRanges::SfxUShortRanges( const SfxUShortRanges &rOrig )
-
-/** <H3>Description</H3>
-
- Copy-Ctor.
-*/
-
{
if ( rOrig._pRanges )
{
@@ -154,17 +139,12 @@ SfxUShortRanges::SfxUShortRanges( const SfxUShortRanges &rOrig )
_pRanges = 0;
}
-
+/**
+ * Constructs a SfxUShortRanges instance from one range of sal_uInt16s.
+ *
+ * Precondition: nWhich1 <= nWhich2
+ */
SfxUShortRanges::SfxUShortRanges( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
-
-/** <H3>Description</H3>
-
- Constructs an SfxUShortRanges-instance from one range of sal_uInt16s.
-
- precondition:
- nWhich1 <= nWhich2
-*/
-
: _pRanges( new sal_uInt16[3] )
{
_pRanges[0] = nWhich1;
@@ -172,18 +152,14 @@ SfxUShortRanges::SfxUShortRanges( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
_pRanges[2] = 0;
}
-
+/**
+ * Constcurts an SfxUShortRanges-instance from an sorted ranges of sal_uInt16s,
+ * terminates with on 0.
+ *
+ * Precondition: for each n >= 0 && n < (sizeof(pArr)-1)
+ * pArr[2n] <= pArr[2n+1] && ( pArr[2n+2]-pArr[2n+1] ) > 1
+ */
SfxUShortRanges::SfxUShortRanges( const sal_uInt16* pArr )
-
-/** <H3>Description</H3>
-
- Constcurts an SfxUShortRanges-instance from an sorted ranges of sal_uInt16s,
- terminates with on 0.
-
- precondition: for each n >= 0 && n < (sizeof(pArr)-1)
- pArr[2n] <= pArr[2n+1] && ( pArr[2n+2]-pArr[2n+1] ) > 1
-*/
-
{
DBG_CHECK_RANGES(sal_uInt16, pArr);
sal_uInt16 nCount = Count_Impl(pArr) + 1;
@@ -221,17 +197,13 @@ bool SfxUShortRanges::operator==( const SfxUShortRanges &rOther ) const
return true;
}
-
+/**
+ * Assigns ranges from 'rRanges' to '*this'.
+ */
SfxUShortRanges& SfxUShortRanges::operator =
(
const SfxUShortRanges &rRanges
)
-
-/** <H3>Description</H3>
-
- Assigns ranges from 'rRanges' to '*this'.
-*/
-
{
// special case: assign itself
if ( &rRanges == this )
@@ -252,21 +224,16 @@ SfxUShortRanges& SfxUShortRanges::operator =
return *this;
}
-
+/**
+ * Merges *this with 'rRanges'.
+ * for each sal_uInt16 n:
+ * this->Contains( n ) || rRanges.Contains( n ) => this'->Contains( n )
+ * !this->Contains( n ) && !rRanges.Contains( n ) => !this'->Contains( n )
+ */
SfxUShortRanges& SfxUShortRanges::operator +=
(
const SfxUShortRanges &rRanges
)
-
-/** <H3>Description</H3>
-
- Merges *this with 'rRanges'.
-
- for each sal_uInt16 n:
- this->Contains( n ) || rRanges.Contains( n ) => this'->Contains( n )
- !this->Contains( n ) && !rRanges.Contains( n ) => !this'->Contains( n )
-*/
-
{
// special cases: one is empty
if ( rRanges.IsEmpty() )
@@ -411,22 +378,17 @@ copy_rest:
return *this;
}
-
+/**
+ * Removes 'rRanges' from '*this'.
+ * for each sal_uInt16 n:
+ * this->Contains( n ) && rRanges.Contains( n ) => !this'->Contains( n )
+ * this->Contains( n ) && !rRanges.Contains( n ) => this'->Contains( n )
+ * !this->Contains( n ) => !this'->Contains( n )
+ */
SfxUShortRanges& SfxUShortRanges::operator -=
(
const SfxUShortRanges &rRanges
)
-
-/** <H3>Description</H3>
-
- Removes 'rRanges' from '*this'.
-
- for each sal_uInt16 n:
- this->Contains( n ) && rRanges.Contains( n ) => !this'->Contains( n )
- this->Contains( n ) && !rRanges.Contains( n ) => this'->Contains( n )
- !this->Contains( n ) => !this'->Contains( n )
-*/
-
{
// special cases: one is empty
if ( rRanges.IsEmpty() || IsEmpty() )
@@ -552,22 +514,17 @@ SfxUShortRanges& SfxUShortRanges::operator -=
return *this;
}
-
+/**
+ * Determines intersection of '*this' with 'rRanges'.
+ * for each sal_uInt16 n:
+ * this->Contains( n ) && rRanges.Contains( n ) => this'->Contains( n )
+ * !this->Contains( n ) => !this'->Contains( n )
+ * !rRanges.Contains( n ) => !this'->Contains( n )
+ */
SfxUShortRanges& SfxUShortRanges::operator /=
(
const SfxUShortRanges &rRanges
)
-
-/** <H3>Description</H3>
-
- Determines intersection of '*this' with 'rRanges'.
-
- for each sal_uInt16 n:
- this->Contains( n ) && rRanges.Contains( n ) => this'->Contains( n )
- !this->Contains( n ) => !this'->Contains( n )
- !rRanges.Contains( n ) => !this'->Contains( n )
-*/
-
{
// boundary cases
// * first set is empty -> nothing to be done
@@ -670,15 +627,11 @@ SfxUShortRanges& SfxUShortRanges::operator /=
return *this;
}
-
+/**
+ * Determines the number of USHORTs in the set described by the ranges
+ * of USHORTs in '*this'.
+ */
sal_uInt16 SfxUShortRanges::Count() const
-
-/** <H3>Description</H3>
-
- Determines the number of USHORTs in the set described by the ranges
- of USHORTs in '*this'.
-*/
-
{
return Capacity_Impl( _pRanges );
}
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index e61f3eb8b50b..7340f16ad16f 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -64,9 +64,9 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint);
SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
(
- sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.)
+ sal_uInt16 nAction, // SFX_STYLESHEET_... (see above)
const OUString& rOldName,
- SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer
+ SfxStyleSheetBase& rStyleSheet // Remains with the caller
)
: SfxStyleSheetHint( nAction, rStyleSheet ),
aName( rOldName )
@@ -75,8 +75,8 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
SfxStyleSheetHint::SfxStyleSheetHint
(
- sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.)
- SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer
+ sal_uInt16 nAction, // SFX_STYLESHEET_... (see above)
+ SfxStyleSheetBase& rStyleSheet // Remains with the caller
)
: pStyleSh( &rStyleSheet ),
nHint( nAction )
@@ -245,8 +245,9 @@ void SfxStyleSheetBase::SetHidden( bool hidden )
pPool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
}
-// Change follow
-
+/**
+ * Change follow
+ */
const OUString& SfxStyleSheetBase::GetFollow() const
{
return aFollow;
@@ -267,8 +268,10 @@ bool SfxStyleSheetBase::SetFollow( const OUString& rName )
return true;
}
-// Set Itemset. The default implementation creates a new set
-
+/**
+ * Set Itemset
+ * The default implementation creates a new set
+ */
SfxItemSet& SfxStyleSheetBase::GetItemSet()
{
if( !pSet )
@@ -279,8 +282,9 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet()
return *pSet;
}
-// Hilfe-Datei und -ID setzen und abfragen
-
+/**
+ * Set help file and ID and return it
+ */
sal_uLong SfxStyleSheetBase::GetHelpId( OUString& rFile )
{
rFile = aHelpFile;
@@ -293,43 +297,52 @@ void SfxStyleSheetBase::SetHelpId( const OUString& rFile, sal_uLong nId )
nHelpId = nId;
}
-// Next style possible? Default: Yes
-
+/**
+ * Next style possible?
+ * Default: Yes
+ */
bool SfxStyleSheetBase::HasFollowSupport() const
{
return true;
}
-// Basisvorlage m"oglich? Default: Ja
-
+/**
+ * Base template possible?
+ * Default: Yes
+ */
bool SfxStyleSheetBase::HasParentSupport() const
{
return true;
}
-// Basisvorlage uf NULL setzen m"oglich? Default: Nein
-
+/**
+ * Setting base template to NULL possible?
+ * Default: No
+ */
bool SfxStyleSheetBase::HasClearParentSupport() const
{
return false;
}
-// Defaultmaessig sind alle StyleSheets Used
-
+/**
+ * By default all stylesheets are set to used
+ */
bool SfxStyleSheetBase::IsUsed() const
{
return true;
}
-// eingestellte Attribute ausgeben
-
+/**
+ * Return set attributes
+ */
OUString SfxStyleSheetBase::GetDescription()
{
return GetDescription( SFX_MAPUNIT_CM );
}
-// eingestellte Attribute ausgeben
-
+/**
+ * Return set attributes
+ */
OUString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric )
{
SfxItemIter aIter( GetItemSet() );
@@ -674,10 +687,10 @@ SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleF
return *xStyle.get();
}
-// Hilfsroutine: Falls eine Vorlage dieses Namens existiert, wird
-// sie neu erzeugt. Alle Vorlagen, die diese Vorlage zum Parent haben,
-// werden umgehaengt.
-
+/**
+ * Helper function: If a template with this name exists it is created
+ * anew. All templates that have this template as a parent are reconnected.
+ */
SfxStyleSheetBase& SfxStyleSheetBasePool::Add( const SfxStyleSheetBase& rSheet )
{
SfxStyleSheetIterator aIter(this, rSheet.GetFamily(), nMask);
@@ -896,16 +909,14 @@ bool SfxStyleSheet::SetParent( const OUString& rName )
const OUString aOldParent(aParent);
if(SfxStyleSheetBase::SetParent(rName))
{
- // aus der Benachrichtigungskette des alten
- // Parents gfs. austragen
+ // Remove from notification chain of the old parent if applicable
if(!aOldParent.isEmpty())
{
SfxStyleSheet *pParent = (SfxStyleSheet *)pPool->Find(aOldParent, nFamily, SFXSTYLEBIT_ALL);
if(pParent)
EndListening(*pParent);
}
- // in die Benachrichtigungskette des neuen
- // Parents eintragen
+ // Add to the notification chain of the new parent
if(!aParent.isEmpty())
{
SfxStyleSheet *pParent = (SfxStyleSheet *)pPool->Find(aParent, nFamily, SFXSTYLEBIT_ALL);
@@ -917,7 +928,9 @@ bool SfxStyleSheet::SetParent( const OUString& rName )
return false;
}
-// Notify all listeners
+/**
+ * Notify all listeners
+ */
void SfxStyleSheet::Notify(SfxBroadcaster& rBC, const SfxHint& rHint )
{
Forward(rBC, rHint);
@@ -945,7 +958,9 @@ SfxStyleSheetBase* SfxStyleSheetPool::Create( const SfxStyleSheet& r )
return new SfxStyleSheet( r );
}
-// class SfxUnoStyleSheet
+/**
+ * class SfxUnoStyleSheet
+ */
SfxUnoStyleSheet::SfxUnoStyleSheet( const OUString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske )
: ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >( _rName, _rPool, _eFamily, _nMaske )
{
@@ -963,7 +978,9 @@ SfxUnoStyleSheet* SfxUnoStyleSheet::getUnoStyleSheet( const ::com::sun::star::un
return pRet;
}
-// XUnoTunnel
+/**
+ * XUnoTunnel
+ */
::sal_Int64 SAL_CALL SfxUnoStyleSheet::getSomething( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& rId ) throw (::com::sun::star::uno::RuntimeException, std::exception)
{
if( rId.getLength() == 16 && 0 == memcmp( getIdentifier().getConstArray(), rId.getConstArray(), 16 ) )