/** initialize this set with a UNO sequence of sal_Int8 (e.g. as stored in settings.xml)
*/ void SdrLayerIDSet::PutValue( const css::uno::Any & rAny )
{
css::uno::Sequence< sal_Int8 > aSeq; if( !(rAny >>= aSeq) ) return;
// Generates a bitfield for settings.xml from the SdrLayerIDSet. // Output is a UNO sequence of BYTE (which is 'short' in API). void SdrLayerAdmin::QueryValue(const SdrLayerIDSet& rViewLayerSet, css::uno::Any& rAny)
{ // tdf#119392 The SdrLayerIDSet in a view is ordered according LayerID, but in file // the bitfield is interpreted in order of layers in <draw:layer-set>. // First generate a new bitfield based on rViewLayerSet in the needed order.
sal_uInt8 aTmp[32]; // 256 bits in settings.xml makes byte 0 to 31 for (auto nIndex = 0; nIndex <32; nIndex++)
{
aTmp[nIndex] = 0;
}
sal_uInt8 nByteIndex = 0;
sal_uInt8 nBitpos = 0;
sal_uInt16 nLayerPos = 0; // Position of the layer in member aLayer and in <draw:layer-set> in file
sal_uInt16 nLayerIndex = 0; for( constauto& pCurrentLayer : maLayers )
{
SdrLayerID nCurrentID = pCurrentLayer->GetID(); if ( rViewLayerSet.IsSet(nCurrentID) )
{
nLayerPos = nLayerIndex;
nByteIndex = nLayerPos / 8; if (nByteIndex > 31) continue; // skip position, if too large for bitfield
nBitpos = nLayerPos % 8;
aTmp[nByteIndex] |= (1 << nBitpos);
}
++nLayerIndex;
}
// Second transform the bitfield to byte sequence, same as in previous version of QueryValue
sal_uInt8 nNumBytesSet = 0; for( auto nIndex = 31; nIndex >= 0; nIndex--)
{ if( 0 != aTmp[nIndex] )
{
nNumBytesSet = nIndex + 1; break;
}
}
css::uno::Sequence< sal_Int8 > aSeq( nNumBytesSet );
std::transform(aTmp, aTmp + nNumBytesSet, aSeq.getArray(),
[](const sal_uInt8 b) { returnstatic_cast<sal_Int8>(b); });
rAny <<= aSeq;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.