Kaydet (Commit) efe57384 authored tarafından Caolán McNamara's avatar Caolán McNamara

cppcheck: variable scope

Change-Id: I27ab82d32df984a86af1a2abda491581bff70a2c
üst 5784ba5f
......@@ -567,7 +567,6 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
nAbsItems = 0;
long nSizeWinSize = 0;
long nNewSizeWinSize = 0;
// first resize absolute items relative
for ( i = 0; i < nItems; i++ )
......@@ -584,6 +583,8 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// do not compensate rounding errors here
if ( (nAbsItems < (sal_uInt16)(std::abs( nSizeDelta ))) && nSizeWinSize )
{
long nNewSizeWinSize = 0;
for ( i = 0; i < nItems; i++ )
{
if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) )
......@@ -595,6 +596,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
}
}
nSizeDelta -= nNewSizeWinSize-nSizeWinSize;
}
......
......@@ -137,11 +137,10 @@ void SalDisplay::DeInitRandR()
void SalDisplay::processRandREvent( XEvent* pEvent )
{
#ifdef USE_RANDR
int nRet = 0;
XConfigureEvent* pCnfEvent=reinterpret_cast<XConfigureEvent*>(pEvent);
if( m_bUseRandRWrapper && pWrapper && pWrapper->XRRRootToScreen(GetDisplay(),pCnfEvent->window) != -1 )
{
nRet = pWrapper->XRRUpdateConfiguration( pEvent );
int nRet = pWrapper->XRRUpdateConfiguration( pEvent );
if( nRet == 1 && pEvent->type != ConfigureNotify) // this should then be a XRRScreenChangeNotifyEvent
{
// update screens
......
......@@ -2368,7 +2368,6 @@ Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const
bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateData,
X_if_predicate i_pPredicate ) const
{
long nTimeout = 1000;
/* #i99360# ugly workaround an X11 library bug
this replaces the following call:
XIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData );
......@@ -2382,6 +2381,7 @@ bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateDat
aFD.fd = ConnectionNumber(GetDisplay());
aFD.events = POLLIN;
aFD.revents = 0;
long nTimeout = 1000;
(void)poll(&aFD, 1, nTimeout);
if( ! XCheckIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ) )
{
......
......@@ -946,8 +946,6 @@ IMPL_LINK_NOARG_TYPED(PrintFontManager, autoInstallFontLangSupport, Timer *, voi
void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes )
{
bool bRet = false;
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
// build pattern argument for fontconfig query
......@@ -1016,6 +1014,8 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
{
if( pSet->nfont > 0 )
{
bool bRet = false;
//extract the closest match
FcChar8* file = nullptr;
FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file);
......
......@@ -778,31 +778,34 @@ namespace xmloff
// get the property names
getValuePropertyNames(m_eType, m_nClassId, pCurrentValuePropertyName, pValuePropertyName);
static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue);
static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value);
static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::CurrentValue);
static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value);
// add the attributes if necessary and possible
if (pCurrentValuePropertyName && (CCAFlags::CurrentValue & m_nIncludeCommon))
{
static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue);
// don't export the current-value if this value originates from a data binding
// #i26944#
if ( controlHasActiveDataBinding() )
exportedProperty( OUString::createFromAscii( pCurrentValuePropertyName ) );
else
{
static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::CurrentValue);
exportGenericPropertyAttribute(
nCurrentValueAttributeNamespaceKey,
pCurrentValueAttributeName,
pCurrentValuePropertyName
);
}
}
if (pValuePropertyName && (CCAFlags::Value & m_nIncludeCommon))
{
static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value);
static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value);
exportGenericPropertyAttribute(
nValueAttributeNamespaceKey,
pValueAttributeName,
pValuePropertyName);
}
OSL_ENSURE((nullptr == pValuePropertyName) == (CCAFlags::NONE == (CCAFlags::Value & m_nIncludeCommon)),
"OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
......
......@@ -151,19 +151,18 @@ void XMLIndexBibliographyConfigurationContext::ProcessAttribute(
}
}
SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference<XAttributeList> & xAttrList )
{
OUString sKey;
bool bSort(true);
// process children here and use default context!
if ( ( nPrefix == XML_NAMESPACE_TEXT ) &&
IsXMLToken( rLocalName, XML_SORT_KEY ) )
{
OUString sKey;
bool bSort(true);
sal_Int16 nLength = xAttrList->getLength();
for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment