SvtMiscOptions_Impl::SvtMiscOptions_Impl() // Init baseclasses first
: ConfigItem( ROOTNODE_MISC )
, m_bIsSymbolsStyleRO( false )
, m_bIconThemeWasSetAutomatically( false )
{ // Use our static list of configuration keys to get his values.
Sequence< OUString > seqNames = GetPropertyNames ( );
Load( seqNames );
Sequence< Any > seqValues = GetProperties ( seqNames );
Sequence< sal_Bool > seqRO = GetReadOnlyStates ( seqNames );
// Safe impossible cases. // We need values from ALL configuration keys. // Follow assignment use order of values in relation to our list of key names!
DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtMiscOptions_Impl::SvtMiscOptions_Impl()\nI miss some values of configuration keys!\n" );
// Copy values from list in right order to our internal member.
sal_Int32 nPropertyCount = seqValues.getLength(); for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
{ if (!seqValues[nProperty].hasValue()) continue; switch( nProperty )
{ case PROPERTYHANDLE_SYMBOLSTYLE :
{
OUString aIconTheme; if (seqValues[nProperty] >>= aIconTheme)
SetIconTheme(aIconTheme, SetModifiedFlag::DONT_SET); else
OSL_FAIL("Wrong type of \"Misc\\SymbolStyle\"!" );
m_bIsSymbolsStyleRO = seqRO[nProperty]; break;
}
}
}
// Enable notification mechanism of our baseclass. // We need it to get information about changes outside these class on our used configuration keys!
EnableNotification( seqNames );
}
// destructor
SvtMiscOptions_Impl::~SvtMiscOptions_Impl()
{
assert(!IsModified()); // should have been committed
}
// Safe impossible cases. // We need values from ALL configuration keys. // Follow assignment use order of values in relation to our list of key names!
DBG_ASSERT( !(rPropertyNames.getLength()!=seqValues.getLength()), "SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()\nI miss some values of configuration keys!\n" );
// Copy values from list in right order to our internal member.
sal_Int32 nPropertyCount = seqValues.getLength(); for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
{ if (!seqValues[nProperty].hasValue()) continue; switch( comphelper::findValue(aInternalPropertyNames, rPropertyNames[nProperty]) )
{ case PROPERTYHANDLE_SYMBOLSTYLE : {
OUString aIconTheme; if (seqValues[nProperty] >>= aIconTheme)
SetIconTheme(aIconTheme, SetModifiedFlag::DONT_SET); else
OSL_FAIL("Wrong type of \"Misc\\SymbolStyle\"!" );
} break;
}
}
}
void SvtMiscOptions_Impl::ImplCommit()
{ if ( !m_bIsSymbolsStyleRO )
{ // Get names of supported properties, create a list for values and copy current values to it.
Sequence< OUString > seqNames { PROPERTYNAME_ICONTHEME };
sal_Int32 nCount = seqNames.getLength();
Sequence< Any > seqValues ( nCount ); auto seqValuesRange = asNonConstRange(seqValues);
OUString value; if (m_bIconThemeWasSetAutomatically) {
value = "auto";
} else {
value = GetIconTheme();
}
seqValuesRange[0] <<= value; // Set properties in configuration.
PutProperties( seqNames, seqValues );
}
}
// private method
Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
{ return Sequence<OUString>
{
PROPERTYNAME_SYMBOLSET,
PROPERTYNAME_ICONTHEME, // SidebarIconSize and NotebookbarIconSize so // notifications for their changes are also broadcast // from SvtMiscOptions
PROPERTYNAME_SIDEBARICONSIZE,
PROPERTYNAME_NOTEBOOKBARICONSIZE
};
}
if ( eOptSymbolsSize == SFX_SYMBOLS_SIZE_AUTO )
{ // Use system settings, we have to retrieve the toolbar icon size from the // Application class
ToolbarIconSize nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize(); if (nStyleIconSize == ToolbarIconSize::Size32)
eOptSymbolsSize = SFX_SYMBOLS_SIZE_32; elseif (nStyleIconSize == ToolbarIconSize::Large)
eOptSymbolsSize = SFX_SYMBOLS_SIZE_LARGE; else
eOptSymbolsSize = SFX_SYMBOLS_SIZE_SMALL;
}
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.